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: 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-10 15:48:49
Message-ID: ab593ca2-268b-ef02-77d4-ea93fdecd6eb@postgrespro.ru
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 10.12.2020 18:12, Pavel Stehule wrote:
>
> My idea was a little bit different. Inside postinit initialize some
> global variables with info if there are event triggers or not. And
> later you can use this variable to start transactions and  other things.
>
> There will be two access to pg_event_trigger, but it can eliminate
> useless and probably more expensive start_transaction and end_transaction.
>

Do you mean some variable in shared memory or GUCs?
It was my first idea - to use some flag in shared memory to make it
possible fast check that there are not event triggers.
But this flag should be sent per database. May be I missed something,
but there is no any per-database shared memory  data structure in Postgres.
Certainly it is possible to organize some hash db->event_info, but it
makes this patch several times more complex.

From my point of view it is better to have separate GUC disabling just
client connection events and switch it on by default.
So only those who need this events with switch it on, other users will
not pay any extra cost for it.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Lukas Meisegeier 2020-12-10 15:49:35 Feature Proposal: Add ssltermination parameter for SNI-based LoadBalancing
Previous Message Pavel Borisov 2020-12-10 15:13:36 Re: Speeding up GIST index creation for tsvectors