Re: PostgreSQL 9.3.5 substring(text from pattern for escape) bug

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: PostgreSQL 9.3.5 substring(text from pattern for escape) bug
Дата
Msg-id 32565.1557590361@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: PostgreSQL 9.3.5 substring(text from pattern for escape) bug  ("Daniel Verite" <daniel@manitou-mail.org>)
Ответы Re: PostgreSQL 9.3.5 substring(text from pattern for escape) bug  (Andrew Gierth <andrew@tao11.riddles.org.uk>)
Список pgsql-bugs
"Daniel Verite" <daniel@manitou-mail.org> writes:
>     Robert Schreiber wrote:
>> What appears to be happening is that the _Q? on the tail_ is being 
>> matched, but _the Q is also being included in the collected data.__

> You seem to expect that % must be non-greedy and let the final Q?
> match 1 Q instead of 0, but there doesn't appear to be anything
> in the doc  that supports this interpretation.
> In fact, it mentions that "%" is comparable to ".*" in POSIX
> regular expressions, and the latter _is_ greedy.

Right.  You could get the behavior you want using a non-greedy quantifier,
but you'd have to use the POSIX regexp functions, not substring().

            regards, tom lane



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

Предыдущее
От: "Daniel Verite"
Дата:
Сообщение: Re: PostgreSQL 9.3.5 substring(text from pattern for escape) bug
Следующее
От: Andrew Gierth
Дата:
Сообщение: Re: PostgreSQL 9.3.5 substring(text from pattern for escape) bug