Re: On login trigger: take three - Mailing list pgsql-hackers

From Konstantin Knizhnik
Subject Re: On login trigger: take three
Date
Msg-id ab593ca2-268b-ef02-77d4-ea93fdecd6eb@postgrespro.ru
Whole thread Raw
In response to Re: On login trigger: take three  (Pavel Stehule <pavel.stehule@gmail.com>)
Responses Re: On login trigger: take three
List 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.

pgsql-hackers by date:

Previous
From: Pavel Borisov
Date:
Subject: Re: Speeding up GIST index creation for tsvectors
Next
From: Lukas Meisegeier
Date:
Subject: Feature Proposal: Add ssltermination parameter for SNI-based LoadBalancing