| От | Tom Lane |
|---|---|
| Тема | Re: BUG #5273: Unexpected function behavior/failure |
| Дата | |
| Msg-id | 29476.1263343544@sss.pgh.pa.us обсуждение |
| Ответ на | BUG #5273: Unexpected function behavior/failure ("Vee" <sefer@hotmail.com>) |
| Ответы |
Re: BUG #5273: Unexpected function behavior/failure
|
| Список | pgsql-bugs |
"Vee" <sefer@hotmail.com> writes:
> -- The problem query
> select data, regexp_matches(data, '(h..l)')
> from test;
>> hello {hell}
> Since I have no "where" clause, I would expect to see all the rows in the
> result of the second case, with possibly a NULL value for the non-matched
> rows.
No. regexp_matches() returns setof something, meaning a row per match.
When you have no match, you get no rows. And that in turn means that
the calling select produces no rows --- just as it could also produce
more than one row from a given table row.
I think the behavior you are after is probably more like that of
substring().
regards, tom lane
В списке pgsql-bugs по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера