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

Re: Returning multiple rowsets from a function

From: Bruno Wolff III <bruno(at)wolff(dot)to>
To: David Fetter <david(at)fetter(dot)org>
Cc: PG Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Returning multiple rowsets from a function
Date: 2005-01-11 16:28:18
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-hackers
On Mon, Jan 10, 2005 at 14:30:36 -0800,
  David Fetter <david(at)fetter(dot)org> wrote:
> 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. :)

If it is OK to treat these as strings you could make one result set
by using union and probably adding a marker column so the app knows
what type each row is.

In response to

pgsql-hackers by date

Next:From: Darcy BuskermolenDate: 2005-01-11 16:32:35
Subject: Re: IBM releases 500 patents
Previous:From: Bruce MomjianDate: 2005-01-11 16:25:54
Subject: Re: RC5 Bundled ...

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