Re: Request to add feature to the Position function

Поиск
Список
Период
Сортировка
От David G. Johnston
Тема Re: Request to add feature to the Position function
Дата
Msg-id CAKFQuwY1fxxXSvdqtvHkP87tJ8VqknwK9T6N8c9JSpw+RPUpEw@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Request to add feature to the Position function  (Brian Dunavant <brian@omniti.com>)
Ответы Re: Request to add feature to the Position function  (Adrian Klaver <adrian.klaver@aklaver.com>)
Список pgsql-general
On Mon, Mar 27, 2017 at 9:03 AM, Brian Dunavant <brian@omniti.com> wrote:
That does not return the correct answer for the original poster's request.

flpg=#
​​
select position('om' in reverse('Tomomasaaaaaaaaaaa'));
 position
----------
       15
(1 row)


​Easy oversight to make - if you reverse the string being searched you must also reverse the string that you are looking for.

That said the OP hasn't actually defined what they mean by "locate" when considered in a backward sense - some length adjustments might be needed to compensate for the length of the term being searched for.

Patches are welcomed.  Given the lack of any links to previous requests of this nature I'd say its not exactly a highly in-demand capability.

David J.

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

Предыдущее
От: Brian Dunavant
Дата:
Сообщение: Re: Request to add feature to the Position function
Следующее
От: Adrian Klaver
Дата:
Сообщение: Re: Request to add feature to the Position function