List Info

Thread: Dropping temporary tables from Postgres 7.1




Dropping temporary tables from Postgres 7.1
user name
2006-04-15 23:09:32
> I use temporary tables in Postgres 7.1 (via
"select foo into temporary
> table
> bar").  These are needed for a short time only. 
I expected they would
> periodically be deleted.

In PG 8.1, at least, they're deleted at session end. 
AOLserver's db pool
mechanism means that might never happen while your site's
up if you tell
it to keep handles around forever as some of us, at least,
do.

Alternatively you can start a transaction, and create the
temp table with
the "on commit drop" clause.  Populate it, use
it, then end the
transaction and poof! It's gone.


--
AOLserver - http://www.aolserver.com/

To Remove yourself from this list, simply send an email to
<listservlistserv.aol.com> with the
body of "SIGNOFF AOLSERVER" in the email
message. You can leave the Subject: field of your email
blank.
Dropping temporary tables from Postgres 7.1
user name
2006-05-05 13:58:23
On 4/15/06, dhogazapacifier.com <dhogazapacifier.com> wrote:
> > I use temporary tables in Postgres 7.1 (via
"select foo into temporary
> > table
> > bar").  These are needed for a short time
only.  I expected they would
> > periodically be deleted.
>
> In PG 8.1, at least, they're deleted at session end. 
AOLserver's db pool
> mechanism means that might never happen while your
site's up if you tell
> it to keep handles around forever as some of us, at
least, do.
>
> Alternatively you can start a transaction, and create
the temp table with
> the "on commit drop" clause.  Populate it,
use it, then end the
> transaction and poof! It's gone.
>
>

This is the best solution.  Until you can do this, though,
an
occasional ns_db bouncepool <poolname> will clean them
up right away.


--
AOLserver - http://www.aolserver.com/

To Remove yourself from this list, simply send an email to
<listservlistserv.aol.com> with the
body of "SIGNOFF AOLSERVER" in the email
message. You can leave the Subject: field of your email
blank.
[1-2]

about | contact  Other archives ( Real Estate discussion Medical topics )