Search Postgresql Archives

Re: Returning NULL to a set returning C type function

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

 



Bborie Park <bkpark@xxxxxxxxxxx> writes:
> I have a C type function that returns a set of a type.  The problem I 
> have is that the underlying function may return NULL.  When the 
> underlying function returns NULL, I get the error message:

> ERROR:  function returning set of rows cannot return null value

> I'm wondering what is the proper way to correct this problem?

Don't do that ;-).  You could choose either to not return any row
at all when this happens, or to construct an all-nulls row to return.
ExecMakeTableFunctionResult doesn't want to guess which behavior is
appropriate for your use-case, so it just complains.

			regards, tom lane

-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


[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