"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