From: Konstantin Knizhnik <k.knizhnik@postgrespro.ru>
To: Pavel Stehule <pavel.stehule@gmail.com>
Cc: PostgreSQL Hackers <pgsql-hackers@postgresql.org>
Subject: Re: On login trigger: take three
Date: Mon, 14 Sep 2020 18:53:10 +0300
Message-ID: <5a3f33c8-6cda-2660-06f4-56482e1b3511@postgrespro.ru> (raw)
In-Reply-To: <CAFj8pRCqbwFAuWFA3pt8_vcbGKxVrBkEaNPpWcwbyfPhhWcXzw@mail.gmail.com>
References: <0d46d29f-4558-3af9-9c85-7774e14a7709@postgrespro.ru>
<CAFj8pRADtXhHTZER+O3efbJk+9gUdnxjHboFwJb_pg6oiXkU2A@mail.gmail.com>
<8d3b01bc-ed93-4f7d-0b2e-661e055fad2e@postgrespro.ru>
<CAFj8pRBdqdqvkU3mVKzoOnO+jPz-6manRV47CDEa+1jD6x6LFg@mail.gmail.com>
<5706c7f5-98cd-bc20-cf1e-dd3f363e2c99@postgrespro.ru>
<CAFj8pRCqbwFAuWFA3pt8_vcbGKxVrBkEaNPpWcwbyfPhhWcXzw@mail.gmail.com>
On 14.09.2020 17:34, Pavel Stehule wrote:
> If we introduce buildin session trigger , we should to define what is
> the session. Your design is much more related to the process than to
> session. So the correct name should be "process_start" trigger, or
> some should be different. I think there are two different events -
> process_start, and session_start, and there should be two different
> event triggers. Maybe the name "session_start" is just ambiguous and
> should be used with a different name.
I agree.
I can rename trigger to backend_start or process_start or whatever else.
>
> 5. I do not quite understand your concern. If I define trigger
> procedure which isĀ blocked (for example as in your example), then
> I can
> use pg_cancel_backend to interrupt execution of login trigger and
> superuser can login. What should be changed here?
>
>
> You cannot run pg_cancel_backend, because you cannot open a new
> session. There is a cycle.
It is always possible to login by disabling startup triggers using
disable_session_start_trigger GUC:
psql "dbname=postgres options='-c disable_session_start_trigger=true'"
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-hackers@postgresql.org
Cc: k.knizhnik@postgrespro.ru, pavel.stehule@gmail.com
Subject: Re: On login trigger: take three
In-Reply-To: <5a3f33c8-6cda-2660-06f4-56482e1b3511@postgrespro.ru>
References: <0d46d29f-4558-3af9-9c85-7774e14a7709@postgrespro.ru> <CAFj8pRADtXhHTZER+O3efbJk+9gUdnxjHboFwJb_pg6oiXkU2A@mail.gmail.com> <8d3b01bc-ed93-4f7d-0b2e-661e055fad2e@postgrespro.ru> <CAFj8pRBdqdqvkU3mVKzoOnO+jPz-6manRV47CDEa+1jD6x6LFg@mail.gmail.com> <5706c7f5-98cd-bc20-cf1e-dd3f363e2c99@postgrespro.ru> <CAFj8pRCqbwFAuWFA3pt8_vcbGKxVrBkEaNPpWcwbyfPhhWcXzw@mail.gmail.com> <5a3f33c8-6cda-2660-06f4-56482e1b3511@postgrespro.ru>
* 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