Re: sql function with empty row

Поиск
Список
Период
Сортировка
От David G. Johnston
Тема Re: sql function with empty row
Дата
Msg-id CAKFQuwbJN0N-AnGQfyTzLaAjbE5+-euMehtPH92rnt-eKmNqeA@mail.gmail.com
обсуждение исходный текст
Ответ на Re: sql function with empty row  (Philipp Kraus <philipp.kraus@tu-clausthal.de>)
Список pgsql-general
On Wed, May 16, 2018 at 11:49 AM, Philipp Kraus <philipp.kraus@tu-clausthal.de> wrote:
I have tested it on my data and it works also, but that is a little bit confusing, because imho setof is >= 0 rows and
without setof it is [0,1].

​Without setof it will always return exactly 1 row, never 0.  This is a feature as returning zero rows is problematic in many ways; a 0-row result in a select-list will cause that row to be removed from the result when is most cases people would rather be told whatever they were trying to compute for the row simply didn't compute - via a NULL.

David J.

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

Предыдущее
От: Nikolay Samokhvalov
Дата:
Сообщение: Re: Rapid disk usage spikes when updating large tables with GIN indexes
Следующее
От: hmidi slim
Дата:
Сообщение: When use triggers?