Re: Temporary tables and miscellaneous schemas - Mailing list pgsql-general

From Bruce Momjian
Subject Re: Temporary tables and miscellaneous schemas
Date
Msg-id 200310272055.h9RKtM529340@candle.pha.pa.us
Whole thread Raw
In response to Re: Temporary tables and miscellaneous schemas  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses grant all to database inheritence  (Dave Cramer <Dave@micro-automation.net>)
grant all to database inheritence  (Dave Cramer <dave@fastcrypt.com>)
List pgsql-general
Tom Lane wrote:
> Bruce Momjian <pgman@candle.pha.pa.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@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073

pgsql-general by date:

Previous
From: CSN
Date:
Subject: sequences: cache_value, log_cnt, is_cycled columns
Next
From: Bruce Momjian
Date:
Subject: Re: Temporary tables and miscellaneous schemas