proper use of temp table in function - Mailing list pgsql-general

From David Gagnon
Subject proper use of temp table in function
Date
Msg-id 20041130151234.48813.qmail@web20323.mail.yahoo.com
Whole thread Raw
List pgsql-general
Hi all,

  Sorry to ask since I'm pretty sure this kind of question have been asked
again an again.  But I searched and haven't found my answer.

So here is the question, please help :-)

In plpgsql function how do you deal with temporary table.  I need do a bunch of
data manipulations in my function before returning a ref cursor.

The problem is that, as you may know, the temp table aren't drop at the end of
the function.  And if I try to drop the tables when the cursor is open on it I
get errors too.

And I need to be able to call the function simultaneously without one
interfering with the other.  So table created by one instance of the function
don't know about tables created by other functions ...


I have 4 big selects to construct the data I need... I can't just put all in a
big one.  So I need a way to store and read data between selects.

Thanks for your help!!

/David



' LANGUAGE 'plpgsql';

CREATE FUNCTION   uk_usp_Comptabilite_AgeDeCompteClient(DATE, VARCHAR, VARCHAR,
INTEGER, INTEGER) RETURNS refcursor AS '
DECLARE



__________________________________
Do you Yahoo!?
All your favorites on one personal page � Try My Yahoo!
http://my.yahoo.com

pgsql-general by date:

Previous
From: Marc@pyrenet.fr, G.Fournier@pyrenet.fr, From@pyrenet.fr:
Date:
Subject: Re: [ANNOUNCE] USENET vs Mailing Lists Poll ...
Next
From: "Sally Ruggero"
Date:
Subject: Re: delete with index scan