Re: BUG #8228: Unexpected "set-valued function" with varchar(n) but not varchar
В списке pgsql-bugs по дате отправления:
| От | 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 по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера