Re: BUG #5469: regexp_matches() has poor behaviour and more poor documentation

Поиск
Список
Период
Сортировка
От Bruce Momjian
Тема Re: BUG #5469: regexp_matches() has poor behaviour and more poor documentation
Дата
Msg-id 201006011431.o51EV0w14740@momjian.us
обсуждение исходный текст
Ответ на Re: BUG #5469: regexp_matches() has poor behaviour and more poor documentation  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-bugs
Tom Lane wrote:
> Robert Haas <robertmhaas@gmail.com> writes:
> > But actually here's an even simpler workaround, which is IMHO less
> > ugly than the original one:
>
> > SELECT foo, bar, (SELECT regexp_matches(bar, pattern)) FROM table;
>
> Doesn't that blow up if the subselect returns more than one row?
>
> I think you could make it work by wrapping regexp_matches in a
> simple (non-SETOF) SQL function, but just writing out the sub-SELECT
> doesn't do it.  This goes back to the recent discussion of why SQL
> functions can't always be inlined --- the semantics are a bit
> different in some cases.

If you don't use 'g' as a third argument, it can't return more than one
row.

--
  Bruce Momjian  <bruce@momjian.us>        http://momjian.us
  EnterpriseDB                             http://enterprisedb.com

  + None of us is going to be here forever. +

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: BUG #5469: regexp_matches() has poor behaviour and more poor documentation
Следующее
От: Bruce Momjian
Дата:
Сообщение: Re: BUG #5469: regexp_matches() has poor behaviour and more poor documentation