Re: observations about temporary tables and schemas - Mailing list pgsql-hackers

From Tom Lane
Subject Re: observations about temporary tables and schemas
Date
Msg-id 25914.1063738514@sss.pgh.pa.us
Whole thread Raw
In response to observations about temporary tables and schemas  ("Merlin Moncure" <merlin.moncure@rcsonline.com>)
List pgsql-hackers
"Merlin Moncure" <merlin.moncure@rcsonline.com> writes:
> The other and more interesting way is to manually jump into the
> temporary schema (eg. pg_temp_x) that hosts a temp table constructed by
> another backend.  While this is unlikely to happen in a normal setting,
> the server does allow it.  Following this, backend X can both see and
> manipulate a temporary table set up by backend Y, including table schema
> manipulation. 

Not unless backend X is run by a superuser.  There are privilege
restrictions against this for ordinary users.  The other behaviors you
note are consequences of the current implementation and might change
in future.

> Also, Is the prohibition of using schemas for temp tables a SQL spec
> requirement or a technical consideration?

The SQL spec's notion of temp tables is only tenuously related to ours
in the first place :-(.  However, the spec appears to require that
references to temp tables be unqualified names, so AFAICT it's not
expected that applications can reference more than one schema's worth
of temp tables anyway.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Dave Smith
Date:
Subject: Re: New thoughts about indexing cross-type comparisons
Next
From: Tom Lane
Date:
Subject: Re: New thoughts about indexing cross-type comparisons