Re: Temp table visibility

From: Andrew Sullivan <ajs(at)crankycanuck(dot)ca>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: Temp table visibility
Date: 2011-08-05 17:53:42
Message-ID: 20110805175341.GS49271@shinkuro.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Fri, Aug 05, 2011 at 10:55:08AM -0400, Tom Lane wrote:
> Also, you can change the priority if you have a mind to, by adding
> "pg_temp" to the search_path explicitly, for example

Hey, that's cool, and it never occurred to me. The current text in
the 9.0 manual says this:

Likewise, the current session's temporary-table schema,
pg_temp_nnn, is always searched if it exists. It can be explicitly
listed in the path by using the alias pg_temp. If it is not listed
in the path then it is searched first (even before
pg_catalog). However, the temporary schema is only searched for
relation (table, view, sequence, etc) and data type names. It is
never searched for function or operator names.

That does not actually entail that if you put pg_temp elsewhere in the
search_path, it will affect things, though I guess it's sort of
implied (I'm a dunce). Could I suggest a patch:

. . . then it is searched first (even before pg_catalog); this can
be changed by explicitly listing pg_temp in the search_path. In
any case, the temporary schema is only searched. . .

?

A

--
Andrew Sullivan
ajs(at)crankycanuck(dot)ca

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Kiryl Mauryshchau 2011-08-05 18:17:36 using raise info to display array element
Previous Message David Johnston 2011-08-05 17:22:59 Re: Filling null values