Re: dynamic OUT parameters?

From: Craig Ringer <craig(at)postnewspapers(dot)com(dot)au>
To: gherzig(at)fmed(dot)uba(dot)ar
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: dynamic OUT parameters?
Date: 2009-01-31 06:18:22
Message-ID: 4983ED2E.4010609@postnewspapers.com.au
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

gherzig(at)fmed(dot)uba(dot)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

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Jasen Betts 2009-01-31 11:47:30 Re: regexp_replace and UTF8
Previous Message gherzig 2009-01-31 00:52:11 Re: dynamic OUT parameters?