Re: temp tables not dropping at end of script - Mailing list pgsql-general

From Relyea, Mike
Subject Re: temp tables not dropping at end of script
Date
Msg-id AF7D9319B29A0242A33C3BF843BD31330C9086A3@USA7061MS03.na.xerox.net
Whole thread Raw
In response to temp tables not dropping at end of script  ("Davenport, Julie" <JDavenport@ctcd.edu>)
List pgsql-general
Since we upgraded from postgres 8.0 to 8.4, every script where we have queries that use temp tables now has to have an
explicitdrop of the temp table at the end of the script, or it will blow up the next time it runs, saying it cannot
createthe temp table because it already exists (these are coldfusion 8 scripts running queries on postgres 8.4
database). When we get the error, if we try to drop the table at the command line, it says the table does not exist,
yetwe cannot rerun the script unless we stop and restart the database.  This never happened with pg 8.0, so the
definitionof "when a session ends" seems to have changed (isn't a temp table supposed to automatically disappear at the
endof the session)?  Is there some easier or better way to clear these temporary areas? 
Thanks,
Julie
julie.davenport@ctcd.edu





I ran in to a similar issue with our scripts.  I took the easy way out and before creating each temp table, I added a
DROPTABLE IF EXISTS statement.  If the table doesn't exist, I get a warning but my script doesn't fail. 

Mike

pgsql-general by date:

Previous
From: Rob Sargent
Date:
Subject: Re: Auto Adjust Age
Next
From: Rob Sargent
Date:
Subject: Re: Auto Adjust Age