pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Jerry Sievers <gsievers19@comcast.net>
Cc: Adrian Klaver <adrian.klaver@aklaver.com>
Cc: pgsql-general@postgresql.org
Subject: Re: Which backend using which pg_temp_N schema?
Date: Wed, 06 Jun 2018 12:11:57 -0400
Message-ID: <11089.1528301517@sss.pgh.pa.us> (raw)
In-Reply-To: <877enbsyf3.fsf@jsievers.enova.com>
References: <87o9go3nok.fsf@jsievers.enova.com>
	<81d847d2-59eb-0094-59cf-b91565213f44@aklaver.com>
	<87k1rc3ibz.fsf@jsievers.enova.com>
	<52ec7e75-9159-7879-fdeb-8d5d120b6ac9@aklaver.com>
	<877enbsyf3.fsf@jsievers.enova.com>

Jerry Sievers <gsievers19@comcast.net> writes:
> Yep thanks... but IMO something that simply exposes whatever internal
> registry of temp schemas/PIDs (which I presume must exist)

Not really.  There are a couple of ways that one could identify a
session's "BackendId", which is the "N" in the "pg_temp_N" name of
the temp schema that it would use if it uses one.  But I do not think
there's any terribly reliable way to tell from outside the session
whether it has actually done anything with the temp schema.  If it
hasn't, then at least in principle there could be objects in the
schema that are left over from a crashed session that previously had
the same BackendId.  We only make an effort to clean out such objects
at the time that a session first creates a temp object.

In any case, I think you're right that this isn't exposed at the SQL
level presently.

			regards, tom lane




view thread (10+ messages)  latest in thread

Message-ID: <11089.1528301517@sss.pgh.pa.us>
Permalink:  ../11089.1528301517@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/11089.1528301517@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: tgl@sss.pgh.pa.us, gsievers19@comcast.net, adrian.klaver@aklaver.com
  Subject: Re: Which backend using which pg_temp_N schema?
  In-Reply-To: <11089.1528301517@sss.pgh.pa.us>
  References: <87o9go3nok.fsf@jsievers.enova.com> <81d847d2-59eb-0094-59cf-b91565213f44@aklaver.com> <87k1rc3ibz.fsf@jsievers.enova.com> <52ec7e75-9159-7879-fdeb-8d5d120b6ac9@aklaver.com> <877enbsyf3.fsf@jsievers.enova.com> <11089.1528301517@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox