Re: BUG #18239: select position ('' in 'A') returns 1

Поиск
Список
Период
Сортировка
От David G. Johnston
Тема Re: BUG #18239: select position ('' in 'A') returns 1
Дата
Msg-id CAKFQuwY3+nE9QjU0vmyDHw1VAH8SWTJX_noX4QZnXDMjpNVMEQ@mail.gmail.com
обсуждение исходный текст
Ответ на BUG #18239: select position ('' in 'A') returns 1  (PG Bug reporting form <noreply@postgresql.org>)
Ответы Re: BUG #18239: select position ('' in 'A') returns 1  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-bugs
On Sunday, December 10, 2023, PG Bug reporting form <noreply@postgresql.org> wrote:
The following bug has been logged on the website:

Bug reference:      18239
Logged by:          Luc Van Linden
Email address:      lucvanlind.en@gmail.com
PostgreSQL version: 15.3
Operating system:   windows 10 64 bit
Description:       

We simplified the bug, or maybe undocumented behavior to its simplest
testcase.

select position ('' in 'A') returns 1

Thus, case a field has an empty string while, checking positions in another
string, it seems to always fit the position 1.

Not sure if this is intended or not, at least we experience this as a bug.


Just as an empty set is a subset of all sets the empty string is a substring within all strings.

I do not believe we document or refer to this external rule anywhere though.

David J.

В списке pgsql-bugs по дате отправления:

Предыдущее
От: jian he
Дата:
Сообщение: Re: BUG #18238: Cross-partitition MERGE/UPDATE with delete-preventing trigger leads to incorrect memory access
Следующее
От: Tom Lane
Дата:
Сообщение: Re: BUG #18239: select position ('' in 'A') returns 1