Re: How can I create null value from function call with no results? - Mailing list pgsql-general

From David G Johnston
Subject Re: How can I create null value from function call with no results?
Date
Msg-id 1406744789730-5813313.post@n5.nabble.com
Whole thread Raw
In response to How can I create null value from function call with no results?  (Seref Arikan <serefarikan@gmail.com>)
Responses Re: How can I create null value from function call with no results?  (Seref Arikan <serefarikan@gmail.com>)
List pgsql-general
Seref Arikan wrote
> select 1,test_empty_row(1);

SELECT 1, (SELECT test_empty_row(1)) AS func_result

You can also adjust the function to either return the result of the query OR
"RETURN NULL" if no results were found.  i.e., do not use "RETURN QUERY"

David J.





--
View this message in context:
http://postgresql.1045698.n5.nabble.com/How-can-I-create-null-value-from-function-call-with-no-results-tp5813311p5813313.html
Sent from the PostgreSQL - general mailing list archive at Nabble.com.


pgsql-general by date:

Previous
From: Pavel Stehule
Date:
Subject: Re: How can I create null value from function call with no results?
Next
From: Merlin Moncure
Date:
Subject: Re: free RAM not being used for page cache