Search Postgresql Archives

Re: sql function with empty row

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, May 16, 2018 at 11:49 AM, Philipp Kraus <philipp.kraus@xxxxxxxxxxxxxxx> 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.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]

  Powered by Linux