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

From Tom Lane
Subject Re: Temporary tables and miscellaneous schemas
Date
Msg-id 7040.1067288494@sss.pgh.pa.us
Whole thread Raw
In response to Re: Temporary tables and miscellaneous schemas  (Sean Chittenden <sean@chittenden.org>)
Responses Re: Temporary tables and miscellaneous schemas
Re: Temporary tables and miscellaneous schemas
List pgsql-general
Sean Chittenden <sean@chittenden.org> writes:
> Um, I forget whether or not this was given any credence or anyone
> weighed in on it, but what about having two modes for psql?  An admin
> mode which hides nothing and is the default for superuser connections,
> and a user mode which is the default for non-DBA connections.

I thought that would be likely to create more confusion than it solves.

To take just one problem, the newbies who could use the "friendly user"
mode are very likely the same ones who do all their work as postgres,
because it hasn't occurred to them to create any unprivileged users.
They won't get the benefit of it if we make it act as you suggest.


BTW, if I lose this argument, there *is* a workable way to get the
behavior Bruce wants: use current_schemas() to detect which temp schema
is in your search path.

regression=# select nspname from pg_namespace;
      nspname
--------------------
 pg_temp_2
 pg_toast
 pg_temp_1
 pg_catalog
 public
 information_schema
(6 rows)

regression=# select nspname from pg_namespace where nspname not like
regression-# 'pg\\_temp\\_%' or nspname = any (current_schemas(true));
      nspname
--------------------
 pg_toast
 pg_catalog
 public
 information_schema
(4 rows)

regression=# create temp table foo(f1 int);
CREATE TABLE
regression=# select nspname from pg_namespace where nspname not like
regression-# 'pg\\_temp\\_%' or nspname = any (current_schemas(true));
      nspname
--------------------
 pg_temp_2
 pg_toast
 pg_catalog
 public
 information_schema
(5 rows)


            regards, tom lane

pgsql-general by date:

Previous
From: Fernando Nasser
Date:
Subject: Multiple database services and multiple versions on Red Hat Linux systems
Next
From: Bruce Momjian
Date:
Subject: Re: Temporary tables and miscellaneous schemas