Re: identifying the backend that owns a temporary schema

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: identifying the backend that owns a temporary schema
Дата
Msg-id 2297420.1664041298@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: identifying the backend that owns a temporary schema  (Nathan Bossart <nathandbossart@gmail.com>)
Ответы Re: identifying the backend that owns a temporary schema  (Nathan Bossart <nathandbossart@gmail.com>)
Список pgsql-hackers
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



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: [BUG] Logical replica crash if there was an error in a function.
Следующее
От: Tom Lane
Дата:
Сообщение: Re: [RFC] building postgres with meson - v13