Search Postgresql Archives

Re: Temporary schemas

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 1 November 2010 10:46, Thomas Kellerer <spam_eater@xxxxxxx> wrote:
Hello,

I have created a temporary table using

create temporary table foo
(
 id integer
);

and noticed this was created in a schema called "pg_temp_2"

My question is:

is this always "pg_temp_2"?
Or will the name of the "temp schema" change?

If it isn't always the same, is there a way I can retrieve the schema name for temporary tables?

Regards
Thomas


You can use:

SELECT nspname
FROM pg_namespace
WHERE oid = pg_my_temp_schema();

to get the name of the current temporary schema for your session.

And it's always pg_temp_[nnn] as far as I'm aware, with a corresponding pg_toast_temp_[nnn] schema.

--
Thom Brown
Twitter: @darkixion
IRC (freenode): dark_ixion
Registered Linux user: #516935

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux