Re: non-static LIKE patterns

Поиск
Список
Период
Сортировка
От hamann.w@t-online.de
Тема Re: non-static LIKE patterns
Дата
Msg-id 4F8677A6.mailxFT71K7US2@amadeus3.local
обсуждение исходный текст
Ответ на non-static LIKE patterns  (patrick keshishian <pkeshish@gmail.com>)
Ответы Re: non-static LIKE patterns  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-general
Tom Lane wrote:

patrick keshishian <pkeshish@gmail.com> writes:
> Thanks for the quick reply. Would be tough choosing another
> "reasonable" ESCAPE character while dealing with paths. Will think
> more about this.

If you want it to be bulletproof, what I'd think about is something like

    WHERE second.path LIKE quote_like(first.path)||'%'

where quote_like() is a function that inserts a backslash before each
backslash, percent, and underscore in the given value.  Probably not
hard to cons that up from regexp_replace().

            regards, tom lane


Just out of curiosity: wouldn't that (as well as using non-static like)
be an enormous performance problem?
I tried something with normal "~" regex matching some time ago but
gave up on the idea pretty soon

Regards
Wolfgang Hamann

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

Предыдущее
От: Albretch Mueller
Дата:
Сообщение: Any information about the PostgreSQL Certified Engineer program?
Следующее
От: Thomas Guettler
Дата:
Сообщение: Value to long for type ....: Columnname missing