Re: On login trigger: take three

From: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
To: Konstantin Knizhnik <k(dot)knizhnik(at)postgrespro(dot)ru>
Cc: Greg Nancarrow <gregn4422(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: On login trigger: take three
Date: 2020-12-17 06:31:45
Message-ID: CAFj8pRAhvfT5bf9xDqjyB_mmtG0nY+cJ4c-abWEHnYoxjBfSXg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

st 16. 12. 2020 v 20:38 odesílatel Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
napsal:

> Attached please find new versoin of the patch based on
> on_connect_event_trigger_WITH_SUGGESTED_UPDATES.patch
>
>> So there is still only "disable_client_connection_trigger" GUC? because
>> we need possibility to disable client connect triggers and there is no such
>> need for other event types.
>>
>> As you suggested have added "dathaslogontriggers" flag which is set when
>> client connection trigger is created.
>> This flag is never cleaned (to avoid visibility issues mentioned in my
>> previous mail).
>>
>
> This is much better - I don't see any slowdown when logon trigger is not
> defined
>
> I did some benchmarks and looks so starting language handler is relatively
> expensive - it is about 25% and starting handler like event trigger has
> about 35%. But this problem can be solved later and elsewhere.
>
> I prefer the inverse form of disable_connection_trigger. Almost all GUC
> are in positive form - so enable_connection_triggger is better
>
> I don't think so current handling dathaslogontriggers is good for
> production usage. The protection against race condition can be solved by
> lock on pg_event_trigger
>

I thought about it, and probably the counter of connect triggers will be
better there. The implementation will be simpler and more robust.

Pavel

> Regards
>
> Pavel
>
>
>
>>
>>
>> --
>> Konstantin Knizhnik
>> Postgres Professional: http://www.postgrespro.com
>> The Russian Postgres Company
>>
>>

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Masahiko Sawada 2020-12-17 06:43:11 Re: [HACKERS] logical decoding of two-phase transactions
Previous Message Andy Fan 2020-12-17 06:29:19 Re: Cache relation sizes?