Received: from maia.hub.org (maia-5.hub.org [200.46.204.29]) by mail.postgresql.org (Postfix) with ESMTP id B4A241337BDB for ; Wed, 9 Mar 2011 11:28:09 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.29]) (amavisd-maia, port 10024) with ESMTP id 51460-05 for ; Wed, 9 Mar 2011 15:28:01 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by mail.postgresql.org (Postfix) with ESMTP id 0649D1337B9C for ; Wed, 9 Mar 2011 11:27:58 -0400 (AST) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.2/8.14.2) with ESMTP id p29FRw44024164; Wed, 9 Mar 2011 10:27:58 -0500 (EST) To: Scott Marlowe cc: gnanam@zoniac.com, pgsql-admin@postgresql.org Subject: Re: Advise on dropping TEMP table/schema for my use case In-reply-to: References: <004a01cbde41$a01544a0$e03fcde0$@com> Comments: In-reply-to Scott Marlowe message dated "Wed, 09 Mar 2011 07:38:01 -0700" Date: Wed, 09 Mar 2011 10:27:58 -0500 Message-ID: <24163.1299684478@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.91 tagged_above=-10 required=5 tests=BAYES_00=-1.9, T_RP_MATCHES_RCVD=-0.01 X-Spam-Level: X-Archive-Number: 201103/101 X-Sequence-Number: 36973 Scott Marlowe writes: > On Wed, Mar 9, 2011 at 3:06 AM, Gnanakumar wrote: >> >> So, now we've decided to either DROP TABLE pg_temp_xx.FOO or DROP SCHEMA >> pg_temp_xx explicitly just before closing the connection (after step 3 and >> before step 4), so that it'll not be visible for the next database >> connection request.  My question is, which one of the option is recommended >> and why? > Why can't you just do: > DROP TABLE FOO; Or if you don't want to remember what you've created, update to 8.3+ so you can use DISCARD? (Or really, so that pg_pool can use DISCARD ... it should be the connection pooler's responsibility to ensure that you get a clean-looking session.) regards, tom lane