From: Tom Lane <tgl@sss.pgh.pa.us>
To: Nathan Bossart <nathandbossart@gmail.com>
Cc: Greg Stark <stark@mit.edu>
Cc: pgsql-hackers@postgresql.org
Subject: Re: identifying the backend that owns a temporary schema
Date: Sat, 24 Sep 2022 13:41:38 -0400
Message-ID: <2297420.1664041298@sss.pgh.pa.us> (raw)
In-Reply-To: <20220829230757.GA542616@nathanxps13>
References: <20220815205811.GA250990@nathanxps13>
<CAM-w4HMZ03AbQjBbfN_mTxct68HX3NPRQVfLaRxLGJTejJ8xbg@mail.gmail.com>
<20220829230757.GA542616@nathanxps13>
Nathan Bossart <nathandbossart@gmail.com> writes:
> On Tue, Aug 23, 2022 at 10:29:05AM +0100, Greg Stark wrote:
>> Alternately should pg_stat_activity show the actual temp schema name
>> instead of the id? I don't recall if it's visible outside the backend
>> but if it is, could pg_stat_activity show whether the temp schema is
>> actually attached or not?
> I'm open to adding the backend ID or the temp schema name to
> pg_stat_activity, but I wouldn't be surprised to learn that others aren't.
FWIW, I'd vote against adding the temp schema per se. We can see from
outside whether the corresponding temp schema exists, but we can't readily
tell whether the session has decided to use it, so attributing it to the
session is a bit dangerous. Maybe there is an argument for having
sessions report it to pgstats when they do adopt a temp schema, but I
think there'd be race conditions, rollback after error, and other issues
to contend with there.
The proposed patch seems like an independent first step in any case.
One thing I don't like about it documentation-wise is that it leaves
the concept of backend ID pretty much completely undefined.
regards, tom lane
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 using the --to and --cc options:
reply via email
To: pgsql-hackers@postgresql.org
Cc: tgl@sss.pgh.pa.us, nathandbossart@gmail.com, stark@mit.edu
Subject: Re: identifying the backend that owns a temporary schema
In-Reply-To: <2297420.1664041298@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