Re: On login trigger: take three

From: Konstantin Knizhnik <k(dot)knizhnik(at)postgrespro(dot)ru>
To: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
Cc: PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: On login trigger: take three
Date: 2020-09-14 15:53:10
Message-ID: 5a3f33c8-6cda-2660-06f4-56482e1b3511@postgrespro.ru
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

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'"

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Ranier Vilela 2020-09-14 15:59:38 Re: Fix overflow at return wchar2char (src/backend/utils/adt/pg_locale.c)
Previous Message Tom Lane 2020-09-14 15:24:51 Re: pg_restore causing deadlocks on partitioned tables