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

From Merlin Moncure
Subject Re: observations about temporary tables and schemas
Date
Msg-id 303E00EBDD07B943924382E153890E5434A9D3@cuthbert.rcsinc.local
Whole thread Raw
In response to observations about temporary tables and schemas  ("Merlin Moncure" <merlin.moncure@rcsonline.com>)
Responses Re: observations about temporary tables and schemas  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
"Tom Lane" <Tom Lane> writes:
>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.

ISTM that if use of qualified names is disallowed you shouldn't be
allowed to create a temporary table with the same name as an existing
table.  Otherwise you have an unclear (or arbitrary) definition of which
table is used in an unqualified reference.  In this case, I think the
SQL spec was not thought out very well.  In my way of thinking,
temporary tables should behave just like normal tables wrt name
resolution.

Also, it's worth noting that qualified names for temp tables are an
allowed syntax except during the create table statement (although in
normal circumstances you would never know the namespace).  Because of
this, qualified name restriction appears to feel like an arbitrary
exclusion.

I did not see a TODO item regarding global temporary tables...has this
been attempted/done?

Regards,
Merlin



pgsql-hackers by date:

Previous
From: "Richard Hall"
Date:
Subject: Re: massive quotes?
Next
From: Alvaro Herrera Munoz
Date:
Subject: Re: Compiling HP-UX 10.20