From: Tom Lane <tgl@sss.pgh.pa.us>
To: gnanam@zoniac.com
Cc: pgsql-admin@postgresql.org
Subject: Re: How to get schema name in which TEMPORARY table is created?
Date: Tue, 08 Mar 2011 10:39:56 -0500
Message-ID: <9914.1299598796@sss.pgh.pa.us> (raw)
In-Reply-To: <005201cbdd99$8930e990$9b92bcb0$@com>
References: <005201cbdd99$8930e990$9b92bcb0$@com>
"Gnanakumar" <gnanam@zoniac.com> writes:
> We're using PostgreSQL v8.2.3.
> How do I get the schema name in which TEMPORARY table is created using
> "CREATE TEMP TABLE mytable ...." syntax?
Do you need the real schema name, or will the "pg_temp" alias be
sufficient?
regression=# create temp table foo(f1 int);
CREATE TABLE
regression=# select * from pg_temp.foo;
f1
----
(0 rows)
Note: I think that this might not work in 8.2.3 --- I seem to recall
that it was added as part of the CVE-2007-2138 fix, which appeared in
the 8.2.x series in 8.2.4. However, there are many good reasons for
you to update to something later than 8.2.3 anyway.
regards, tom lane
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-admin@postgresql.org
Cc: tgl@sss.pgh.pa.us, gnanam@zoniac.com
Subject: Re: How to get schema name in which TEMPORARY table is created?
In-Reply-To: <9914.1299598796@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox