Re: On login trigger: take three
Pavel Stehule <pavel.stehule@gmail.com>
From: Pavel Stehule <pavel.stehule@gmail.com>
To: Konstantin Knizhnik <k.knizhnik@postgrespro.ru>
Cc: PostgreSQL Hackers <pgsql-hackers@postgresql.org>
Date: 2020-09-14T16:11:46Z
Lists: pgsql-hackers
po 14. 9. 2020 v 17:53 odesílatel Konstantin Knizhnik < k.knizhnik@postgrespro.ru> napsal: > > > 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. > Creating a good name can be hard - it is not called for any process - so maybe "user_backend_start" ? > > >> >> 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'" > sure, I know. Just this behavior can be a very unpleasant surprise, and my question is if it can be fixed. Creating custom libpq variables can be the stop for people that use pgAdmin.
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