Re: Position() Bug ? In PostgreSQL 9.2

Поиск
Список
Период
Сортировка
От dinesh kumar
Тема Re: Position() Bug ? In PostgreSQL 9.2
Дата
Msg-id CALnrH7qNnWCRowOTpsLd6A7S=bncw421_fKiNNWTKMFdr=7+=g@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Position() Bug ? In PostgreSQL 9.2  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-general

Hi Tom,

Thank you very much for the clarification.

Let me set an empty string validation,  before passing it to position() from API.

Thank you once again.

Regards,
Dinesh
manojadinesh.blogspot.com

On 2 May 2013 19:19, "Tom Lane" <tgl@sss.pgh.pa.us> wrote:
dinesh kumar <dineshkumar02@gmail.com> writes:
> postgres=# select position('' in 'PostgreSQL'); *// position(Substring as
> an empty string) is returning 1.*
>  position
> ----------
>         1
> (1 row)

This is correct according to the SQL standard:

         <position expression> determines the first position, if any, at
         which one string, S1, occurs within another, S2. If S1 is of length
         zero, then it occurs at position 1 (one) for any value of S2. If S1
         does not occur in S2, then zero is returned.

                        regards, tom lane

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Position() Bug ? In PostgreSQL 9.2
Следующее
От: Larry Rosenman
Дата:
Сообщение: Re: LONG delete with LOTS of FK's