Skip site navigation (1) Skip section navigation (2)

Re: [GENERAL] Temporary tables and miscellaneous schemas

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Tom Lane <tgl(at)sss(dot)pgh(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 20:13:03
Message-ID: 200312222013.hBMKD3S23003@candle.pha.pa.us (view raw or flat)
Thread:
Lists: pgsql-hackerspgsql-patches
Tom Lane wrote:
> Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us> writes:
> > OK, the following patch uses UNION and an =ANY() join to the
> > current_schemas() array to suppress non-local temp schemas, but display
> > all other schemas.
> 
> 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.  In fact, it seems more valuable than
the information containted in pg_toast.  

The attached patch documents that non-local temp tables are suppressed. 
As for people accidentally hardcoding the temp table schema in their
scripts, I don't see how someone would make that mistake with a schema
called pg_temp_##.  It is sort of like assuming a file will always exist
in /tmp.

One nifty idea would be for pg_temp.* to alway refer to your local temp
schema.  Is that a TODO?

-- 
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman(at)candle(dot)pha(dot)pa(dot)us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073

In response to

Responses

pgsql-hackers by date

Next:From: Tom LaneDate: 2003-12-22 21:49:22
Subject: Re: [COMMITTERS] pgsql-server/doc/src/sgml Tag: REL7_4_STABLE r ...
Previous:From: Bruce MomjianDate: 2003-12-22 18:50:39
Subject: Re: [COMMITTERS] pgsql-server/doc/src/sgml Tag: REL7_4_STABLE

pgsql-patches by date

Next:From: Tom LaneDate: 2003-12-22 21:59:48
Subject: Re: [GENERAL] Temporary tables and miscellaneous schemas
Previous:From: Andrew DunstanDate: 2003-12-22 18:28:18
Subject: Re: [HACKERS] Current Win32 port status

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group