Re: dynamic OUT parameters? - Mailing list pgsql-sql

From Craig Ringer
Subject Re: dynamic OUT parameters?
Date
Msg-id 4983ED2E.4010609@postnewspapers.com.au
Whole thread Raw
In response to Re: dynamic OUT parameters?  (gherzig@fmed.uba.ar)
Responses Re: dynamic OUT parameters?  (gherzig@fmed.uba.ar)
List pgsql-sql
gherzig@fmed.uba.ar wrote:

> Oh, that looks promising. I wrongly supposed that RETURNING SETOF RECORD
> forces the use of OUT parameters. I will give your idea a try.

Tom Lane's point about using a refcursor is (unsurprisingly) a good one.
If you return a refcursor from your function, you don't have to do any
special work to call the function, and you can (with most DB access
APIs) FETCH records from the cursor rather conveniently.

See:

http://www.postgresql.org/docs/8.3/static/plpgsql-cursors.html

--
Craig Ringer


pgsql-sql by date:

Previous
From: gherzig@fmed.uba.ar
Date:
Subject: Re: dynamic OUT parameters?
Next
From: Jasen Betts
Date:
Subject: Re: regexp_replace and UTF8