Re: [GENERAL] Temporary tables and miscellaneous schemas

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
Cc: Sean Chittenden <sean(at)chittenden(dot)org>, PostgreSQL-patches <pgsql-patches(at)postgresql(dot)org>, btober(at)seaworthysys(dot)com
Subject: Re: [GENERAL] Temporary tables and miscellaneous schemas
Date: 2003-12-22 21:59:48
Message-ID: 18469.1072130388@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-patches

Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us> writes:
> Tom Lane wrote:
>> Why are you doing any of this? We had agreed to suppress all temp
>> schemas, period. The query should be simple.

> I know some feel that showing any temporary schemas is wrong, but it
> seems that the local temp schema has valuable information. If I do \d
> pg_temp_1.*, I see all my temporary tables. I know we have a TODO to
> show all existing prepared statements, and giving people a way to see
> their temp tables seems important.

We already have a way to find out your temp table schema name:
current_schemas.

regression=# create temp table foo(f1 int);
CREATE TABLE
regression=# select current_schemas(true);
current_schemas
-------------------------------
{pg_temp_1,pg_catalog,public}
(1 row)

regression=# select (current_schemas(true))[1];
current_schemas
-----------------
pg_temp_1
(1 row)

regression=# select relname from pg_class c join pg_namespace n
regression-# on relnamespace = n.oid
regression-# where nspname = (current_schemas(true))[1];
relname
---------
foo
(1 row)

I don't think it's reasonable to complicate \dn so much in order to
provide an alternative way of learning your temp schema name.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2003-12-22 22:01:42 Re: [GENERAL] Temporary tables and miscellaneous schemas
Previous Message Tom Lane 2003-12-22 21:49:22 Re: [COMMITTERS] pgsql-server/doc/src/sgml Tag: REL7_4_STABLE r ...

Browse pgsql-patches by date

  From Date Subject
Next Message Bruce Momjian 2003-12-22 22:01:42 Re: [GENERAL] Temporary tables and miscellaneous schemas
Previous Message Bruce Momjian 2003-12-22 20:13:03 Re: [GENERAL] Temporary tables and miscellaneous schemas