X-Original-To: pgsql-sql@postgresql.org Received: from spampd.localdomain (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id BFA49475B99 for ; Fri, 4 Apr 2003 09:58:27 -0500 (EST) Received: from sss.pgh.pa.us (unknown [192.204.191.242]) by postgresql.org (Postfix) with ESMTP id 03587475B47 for ; Fri, 4 Apr 2003 09:58:27 -0500 (EST) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.12.9/8.12.9) with ESMTP id h34EwO2L005649; Fri, 4 Apr 2003 09:58:24 -0500 (EST) To: Christoph Haller Cc: pgsql-sql@postgresql.org, m.papper@fantastic.com Subject: Re: Finding if a temp table exists in the current connection In-reply-to: <3E8D6980.5060308@rodos.fzk.de> References: <3E8D6980.5060308@rodos.fzk.de> Comments: In-reply-to Christoph Haller message dated "Fri, 04 Apr 2003 13:16:16 +0200" Date: Fri, 04 Apr 2003 09:58:24 -0500 Message-ID: <5648.1049468304@sss.pgh.pa.us> From: Tom Lane X-Spam-Status: No, hits=-32.3 required=5.0 tests=BAYES_00,EMAIL_ATTRIBUTION,IN_REP_TO,QUOTED_EMAIL_TEXT, REFERENCES,REPLY_WITH_QUOTES autolearn=ham version=2.50 X-Spam-Level: X-Spam-Checker-Version: SpamAssassin 2.50 (1.173-2003-02-20-exp) X-Archive-Number: 200304/66 X-Sequence-Number: 12767 Christoph Haller writes: > It looks like they are created in name spaces called "pg_temp_, > where N is simply a connection counter. Right. If you are trying to find out which N applies to your session, here is one way: regression=# select current_schemas(true); current_schemas --------------------- {pg_catalog,public} (1 row) regression=# create temp table z(f1 int); CREATE TABLE regression=# select current_schemas(true); current_schemas ------------------------------- {pg_temp_2,pg_catalog,public} (1 row) regards, tom lane