Re: BUG #8228: Unexpected "set-valued function" with varchar(n) but not varchar

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: BUG #8228: Unexpected "set-valued function" with varchar(n) but not varchar
Дата
Msg-id 19327.1371159841@sss.pgh.pa.us
обсуждение исходный текст
Ответ на BUG #8228: Unexpected "set-valued function" with varchar(n) but not varchar  (david.g.johnston@gmail.com)
Список pgsql-bugs
David Johnston <david.g.johnston@gmail.com> writes:
> The issue with the regexp_matches call generally is that absence of a "g"
> modifier means that the set-returning function will never return a set.  It
> would seem to make more sense to not make that a modifier but instead have
> one function defined to return a set (i.e., the current definition) and
> another one defined to return a simply text[].

Well, it does return a set, namely either zero or one row.  The point of
the sub-SELECT workaround is to transform the zero-row case to a scalar
NULL.

I tend to agree that this API wasn't that well thought out, but it's
really not regexp_matches()'s fault that you're running into this
problem --- rather, it's the fact that one arm of the CASE can return a
set while the other can't.

            regards, tom lane

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

Предыдущее
От: matt.s@aptalaska.com
Дата:
Сообщение: BUG #8229: Dropuser and create user segfault for users in ldap
Следующее
От: David Johnston
Дата:
Сообщение: Re: BUG #8228: Unexpected "set-valued function" with varchar(n) but not varchar