X-Original-To: pgsql-sql@postgresql.org Received: from spampd.localdomain (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id C8CC74761BC for ; Wed, 2 Apr 2003 14:56:17 -0500 (EST) Received: from news.hub.org (news.hub.org [64.49.215.80]) by postgresql.org (Postfix) with ESMTP id E35F2475F5F for ; Wed, 2 Apr 2003 14:56:16 -0500 (EST) Received: by news.hub.org (Postfix, from userid 8) id BD08D43A89E; Wed, 2 Apr 2003 14:56:16 -0500 (EST) From: Mike Papper X-Newsgroups: comp.databases.postgresql.sql Subject: Finding if a temp table exists in the current connection Date: Wed, 02 Apr 2003 00:09:33 -0800 Organization: Fantastic Lines: 16 Message-ID: Reply-To: m.papper@fantastic.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7Bit X-Complaints-To: usenet@news.hub.org Mail-Copies-To: m.papper@fantastic.com User-Agent: KNode/0.6.1 To: pgsql-sql@postgresql.org X-Spam-Status: No, hits=-3.0 required=5.0 tests=BAYES_20,DATE_IN_PAST_06_12,USER_AGENT version=2.50 X-Spam-Level: X-Spam-Checker-Version: SpamAssassin 2.50 (1.173-2003-02-20-exp) X-Archive-Number: 200304/40 X-Sequence-Number: 12741 Is there a way (i.e., access theinternal pg_ tables) to find out if a particular temp table already exists (in the current connection)? I have written some stored procedures that check if a table exists and if a column exists in a table. This is used so I can perform upgrades of our system (if table doesnt exist, call create table... sql). I would like to do a similar thing for temp tables. I have noticed that if another connection creates a temp table, it will show up in the pg_* tables so that all ocnnections can see the table. Is there some standard SQL way to test? -- Mike Papper