Re: How can I create null value from function call with no results?

From: David G Johnston <david(dot)g(dot)johnston(at)gmail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: How can I create null value from function call with no results?
Date: 2014-07-30 18:26:29
Message-ID: 1406744789730-5813313.post@n5.nabble.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: 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.

In response to

Responses

Browse pgsql-general by date

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