Search Postgresql Archives

Re: Temp table visibility

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Andrew Sullivan <ajs@xxxxxxxxxxxxxxx> writes:
> On Fri, Aug 05, 2011 at 08:35:37AM -0400, JJ wrote:
>> I was recently looking at the way "create temp table as" works and the manual specifies that temp tables given the same name as an existing table will be used instead of the permanent table.  It also states that the permanent table can be accessed via its schema-qualified name.  I may have answered my own question but is there any way to emulate this table visibility functionality when referencing tables by their schema-qualified name? 

> No, because the schema qualification is what makes for the visibility
> functionality.

Also, you can change the priority if you have a mind to, by adding
"pg_temp" to the search_path explicitly, for example

	SET search_path = public, pg_temp;

If there's no explicit reference to pg_temp in search_path then it's
implicitly searched first, which is why unqualified references to temp
table names work the way the manual says.

			regards, tom lane

-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux