From: Bruce Momjian <pgman@candle.pha.pa.us>
To: Andrew Bartley <abartley@evolvosystems.com>
Cc: pgsql-general@postgresql.org
Subject: Re: Temp tables
Date: Mon, 19 Aug 2002 22:43:34 -0400 (EDT)
Message-ID: <200208200243.g7K2hYH18264@candle.pha.pa.us> (raw)
In-Reply-To: <027901c247df$6c322560$3200a8c0@abartleypc>
Andrew Bartley wrote:
> Hi all,
>
> Can someone tell me what the difference is in a plpgsql function
> between dropping a temp table at the end of a function and not
> dropping the temp tables.
>
> What other tables does it have an effect on?
>
> It appears there is some overhead when the drop is being executed.
>
> Is there some simple doco I can read to clue me up on the process?
You can drop it whenever you want. If not, it drops on session exit.
On issue with plpgsql is that when you create a temp table in a function
and drop it, then call the function again, it still think the original
temp table exists. You need to use EXECUTE in plpgsql if you want to
drop/create temp tables multiple times in the same session.
--
Bruce Momjian | http://candle.pha.pa.us
pgman@candle.pha.pa.us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-general@postgresql.org
Cc: pgman@candle.pha.pa.us, abartley@evolvosystems.com
Subject: Re: Temp tables
In-Reply-To: <200208200243.g7K2hYH18264@candle.pha.pa.us>
References: <027901c247df$6c322560$3200a8c0@abartleypc> <200208200243.g7K2hYH18264@candle.pha.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox