"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 ---------------------------(end of broadcast)--------------------------- TIP 7: don't forget to increase your free space map settings