Re: pg_temp schemas - Mailing list pgsql-general

From Tom Lane
Subject Re: pg_temp schemas
Date
Msg-id 15888.1044566755@sss.pgh.pa.us
Whole thread Raw
In response to Re: pg_temp schemas  ("Fernando Papa" <fpapa@claxson.com>)
List pgsql-general
"Fernando Papa" <fpapa@claxson.com> writes:
> What is the origin of these schemas? local temporary tables? sorts?

Right, they're made to hold temporary tables.  The first time a given
backend does CREATE TEMP TABLE, it looks for a pg_temp_n schema, and
makes it if it's not there.  On shutdown, it removes the temp tables,
but it seemed like a waste of cycles to remove the pg_temp_n schema
itself.

(ObTrivialFact: the 'n' is the backend's pgproc slot number, so it's
known not to be in use by any concurrently running backend.  But it
will certainly be used again in future.)

            regards, tom lane

pgsql-general by date:

Previous
From: Bruno Wolff III
Date:
Subject: Re: OT: This list is Razored
Next
From: greg@turnstep.com
Date:
Subject: Re: List online archives and spam