Re: C Language Stored Procedure Returning No Data

From: Michael Fuhr <mike(at)fuhr(dot)org>
To: bfraci(at)aol(dot)com
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: C Language Stored Procedure Returning No Data
Date: 2006-02-03 00:17:53
Message-ID: 20060203001752.GA76407@winnie.fuhr.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Wed, Feb 01, 2006 at 12:56:30PM -0500, bfraci(at)aol(dot)com wrote:
> From a C stored procedure, how can I tell Postgres to pass on to
> the Java client that there is No Data? A zero length byte array or
> a null value is not the same as No Data.

If you declare the function with "RETURNS bytea" then the function
must return something; if zero-length data and NULL aren't suitable
for indicating no data then you could raise an error and catch that
error in the client. Another possibility would be to make the
function set-returning ("RETURNS SETOF bytea" and some code changes)
and return no rows to indicate no data.

--
Michael Fuhr

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Arun Kannapiran 2006-02-03 00:20:08 PgSQL as part of commercial product
Previous Message Tony Caduto 2006-02-02 23:37:42 Re: question about MAKE_EXPIRED_TUPLES_VISIBLE