Return a "results set", use a temporary table or use a table?

From: Hadley Willan <hadley(dot)willan(at)deeper(dot)co(dot)nz>
To: pgsql-general(at)postgresql(dot)org
Subject: Return a "results set", use a temporary table or use a table?
Date: 2002-10-22 23:27:54
Message-ID: 1035329274.2056.72.camel@orac.area51.deeper.co.nz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi. I've got three functions A,B and C.
C is designed that it can be used by both A and B and recieves it's
parameters accordingly.

However, my question is, what is the best way I can use to operate on
the results that are generated by C. What I mean is A or B will call
into C and, C will generate a "results set" that A or B need to use.

Therefore, should C be returning that results set? (how? just point me
to docs somewhere as I can't return a RECORD and a ROWTYPE only has a
single row
Or should C be creating a temporary table for A or B to use? Can
postgres do that?
Or should I create a table called X that I stuff the results from C
into, operate on with A or B then have A or B delete all records from?

I saw an example from someone earlier that returned a "setof", but I
can't seem to find that in the docs or a list of valid RETURN types for
functions?

Thank You.
Hadley

--
Hadley Willan > Systems Development > Deeper Design Limited.
hadley(at)deeper(dot)co(dot)nz > www.deeperdesign.com > +64 (21) 28 41 463

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Nils-Erik Svangård 2002-10-23 00:02:02 Recover data from crashed HD
Previous Message Bill 2002-10-22 21:31:26 my apologies