Received: from maia.hub.org (maia-3.hub.org [200.46.204.243]) by mail.postgresql.org (Postfix) with ESMTP id 664D31337BC4 for ; Tue, 8 Mar 2011 10:47:38 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.243]) (amavisd-maia, port 10024) with ESMTP id 69000-03-3 for ; Tue, 8 Mar 2011 14:47:31 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from rs73.luxsci.com (rs73.luxsci.com [64.49.254.135]) by mail.postgresql.org (Postfix) with ESMTP id A96A31337BF9 for ; Tue, 8 Mar 2011 10:47:27 -0400 (AST) Received: from GNANAM ([180.151.61.10]) (authenticated bits=0) by rs73.luxsci.com (8.13.8/8.13.8) with ESMTP id p28ElL74002186; Tue, 8 Mar 2011 08:47:23 -0600 Reply-To: From: "Gnanakumar" To: Cc: References: <005201cbdd99$8930e990$9b92bcb0$@com> In-Reply-To: <005201cbdd99$8930e990$9b92bcb0$@com> Subject: Re: How to get schema name in which TEMPORARY table is created? Date: Tue, 8 Mar 2011 20:13:43 +0530 Organization: Zoniac Software Private Limited Message-ID: <005701cbdd9f$3af822b0$b0e86810$@com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Office Outlook 12.0 Thread-Index: AcvdmYKMzbMBxiW4Qk+lhUKg+CzWvgAA/oRQ Content-Language: en-us X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.9 tagged_above=-10 required=5 tests=BAYES_00=-1.9 X-Spam-Level: X-Archive-Number: 201103/88 X-Sequence-Number: 36960 > select n.nspname from pg_class c join pg_namespace n on n.oid=c.relnamespace > where c.relname ='foo' and n.nspname like 'pg_temp%'; This will return all the schema name that are available which were created using TEMP TABLE syntax. Since our application is web-based, of course, there will be more than one schema name listed out of this query. My question is, how do I get the schema name of the temporary table immediately after calling "CREATE TEMP TABLE mytable ...." syntax? I need this schema name for one of my analysis purpose.