Re: [ADMIN] How to get schema name in which TEMPORARY table is created?

2011-03-09 Thread Christian Ullrich
* Gnanakumar wrote: 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? SELECT nspname FROM pg_namespace WHERE oid = pg_my_temp_schema(); I don't have an 8.2.3 lying around, but git says that function

[ADMIN] How to get schema name in which TEMPORARY table is created?

2011-03-08 Thread Gnanakumar
Hi, 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? In our application, we're creating temporary table with the same as an existing permanent table which is available in public schema. Hence, I want to

Re: [ADMIN] How to get schema name in which TEMPORARY table is created?

2011-03-08 Thread Gnanakumar
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

Re: [ADMIN] How to get schema name in which TEMPORARY table is created?

2011-03-08 Thread Tom Lane
Gnanakumar gna...@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

Re: [ADMIN] How to get schema name in which TEMPORARY table is created?

2011-03-08 Thread Gnanakumar
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? I need the real schema name (for example, pg_temp_xxx) in which it is created and not just the alias. --