Skip site navigation (1) Skip section navigation (2)

Returning multiple rowsets from a function

From: David Fetter <david(at)fetter(dot)org>
To: PG Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Returning multiple rowsets from a function
Date: 2005-01-10 22:30:36
Message-ID: 20050110223036.GB22504@fetter.org (view raw or flat)
Thread:
Lists: pgsql-hackers
Kind people,

I've got an issue that must have come up before.  Here's the use case:

Middleware sends in a person_id.
Back-end returns several rowsets: address, email, phone, each of
independent, variable length.

How do people usually handle this?  I've come up with a horrible hack
involving ARRAYs, but there has to be another way.  Jan mentioned
doing something with REFCURSORS, but I'm not sure how those and this
problem might connect.

Are there standard ways to do this?  If so, what might they be?  Some
code or doc examples would be great. :)

Cheers,
D
-- 
David Fetter david(at)fetter(dot)org http://fetter.org/
phone: +1 510 893 6100   mobile: +1 415 235 3778

Remember to vote!

Responses

pgsql-hackers by date

Next:From: Tom LaneDate: 2005-01-10 23:42:43
Subject: Re: Verbosity of column definition mismatch error
Previous:From: Brendan JurdDate: 2005-01-10 21:51:08
Subject: Verbosity of column definition mismatch error

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group