Re: Temp table visibility - Mailing list pgsql-general

From Andrew Sullivan
Subject Re: Temp table visibility
Date
Msg-id 20110805175341.GS49271@shinkuro.com
Whole thread Raw
In response to Re: Temp table visibility  (Tom Lane <tgl@sss.pgh.pa.us>)
List 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@crankycanuck.ca

pgsql-general by date:

Previous
From: "David Johnston"
Date:
Subject: Re: Filling null values
Next
From: Kiryl Mauryshchau
Date:
Subject: using raise info to display array element