Re: 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>, btober(at)seaworthysys(dot)com, pgsql-general(at)postgresql(dot)org
Subject: Re: Temporary tables and miscellaneous schemas
Date: 2003-10-27 20:55:22
Message-ID: 200310272055.h9RKtM529340@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Tom Lane wrote:
> Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us> writes:
> > Tom Lane wrote:
> >> This will certainly not work, since you don't own your pg_temp_* schema
> >> (the bootstrap UID does). I disagree with the goal anyway ...
>
> > OK, others liked the goal of showing only your local schema --- what is
> > your proposal?
>
> My proposal is to do nothing ;-).
>
> If you want to suppress *all* pg_temp_ schemas from the \dn listing,
> that would be defensible maybe. I'd be inclined to say that pg_toast
> should be hidden as well if that approach is taken, because then you are
> basically saying that \dn is not the truth but only the stuff we think
> you should be interested in. (This is why I don't agree with it.)

The main problem is that someone with 1k connection is seeing 1k
pg_temp_* schemas lists, which certainly isn't good.

Maybe we could do a UNION and add a "pg_temp_*" line to stand for all
pg_temp_ schemas. Another idea would be to print a message at the
bottom saying other temp schemas were supressed. By showing the temp
schema name, you can see all your temp tables:

test=> create temp table x(y int);
CREATE TABLE
test=> \dn
List of schemas
Name | Owner
--------------------+----------
information_schema | postgres
pg_catalog | postgres
pg_temp_1 | postgres
pg_temp_2 | postgres
pg_toast | postgres
public | postgres
(6 rows)

test=> \d pg_temp_1.*
Table "pg_temp_1.x"
Column | Type | Modifiers
--------+---------+-----------
y | integer |

This seems like a good reason for the patch so people can see their own
schemas --- I don't think people are using \dn as an authorative result
--- they can always select from pg_namespace.

--
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

Browse pgsql-general by date

  From Date Subject
Next Message Fernando Nasser 2003-10-27 20:59:36 Multiple database services and multiple versions on Red Hat Linux systems
Previous Message CSN 2003-10-27 20:53:50 sequences: cache_value, log_cnt, is_cycled columns