Re: On login trigger: take three
Konstantin Knizhnik <k.knizhnik@postgrespro.ru>
From: Konstantin Knizhnik <k.knizhnik@postgrespro.ru>
To: Pavel Stehule <pavel.stehule@gmail.com>
Cc: Greg Nancarrow <gregn4422@gmail.com>,
PostgreSQL Hackers <pgsql-hackers@postgresql.org>
Date: 2020-12-10T15:48:49Z
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.
Commits
-
Fix some typos in event trigger docs
- 5fce30e77fe1 17.0 landed
-
Use heap_inplace_update() to unset pg_database.dathasloginevt
- 8be93177c46b 17.0 landed
-
Remove the flaky check in event_trigger_login regression test
- 4b885d01f967 17.0 landed
-
Fix instable 006_login_trigger.pl test
- 06be01eb266b 17.0 landed
-
Add support event triggers on authenticated login
- e83d1b0c40cc 17.0 landed
-
Add GUC for temporarily disabling event triggers
- 7750fefdb2b8 17.0 landed
-
Fix typo in reference to __FreeBSD__.
- e52f8b301ed5 16.0 cited
-
Restore robustness of TAP tests that wait for postmaster restart.
- f452aaf7d4a9 14.0 cited
-
Restore the portal-level snapshot after procedure COMMIT/ROLLBACK.
- 84f5c2908dad 14.0 cited