Re: Re[3]: On login trigger: take three
Greg Nancarrow <gregn4422@gmail.com>
From: Greg Nancarrow <gregn4422@gmail.com>
To: Ivan Panchenko <wao@mail.ru>
Cc: Pavel Stehule <pavel.stehule@gmail.com>, PostgreSQL Hackers <pgsql-hackers@postgresql.org>,
Amit Kapila <amit.kapila16@gmail.com>, Masahiko Sawada <sawada.mshk@gmail.com>,
Konstantin Knizhnik <k.knizhnik@postgrespro.ru>
Date: 2021-05-21T04:46:11Z
Lists: pgsql-hackers
On Thu, May 20, 2021 at 2:45 PM Ivan Panchenko <wao@mail.ru> wrote:
>
> I have upgraded the patch for the 14th version.
>
I have some feedback on the patch:
(1) The patch adds 3 whitespace errors ("git apply <patch-file>"
reports 3 warnings)
(2) doc/src/sgml/catalogs.sgml
CURRENTLY:
This flag is used to avoid extra lookup of pg_event_trigger table on
each backend startup.
SUGGEST:
This flag is used to avoid extra lookups on the pg_event_trigger table
during each backend startup.
(3) doc/src/sgml/config.sgml
CURRENTLY:
Errors in trigger code can prevent user to login to the system.In this
case disabling this parameter in connection string can solve the
problem:
SUGGEST:
Errors in the trigger code can prevent a user from logging in to the
system. In this case, the parameter can be disabled in the connection
string, to allow the user to login:
(4) doc/src/sgml/event-trigger.sgml
(i)
CURRENTLY:
An event trigger fires whenever the event with which it is associated
occurs in the database in which it is defined. Currently, the only
SUGGEST:
An event trigger fires whenever an associated event occurs in the
database in which it is defined. Currently, the only
(ii)
CURRENTLY:
can be useful for client connections logging,
SUGGEST:
can be useful for logging client connections,
(5) src/backend/commands/event_trigger.c
(i) There are two instances of code blocks like:
xxxx = table_open(...);
tuple = SearchSysCacheCopy1(...);
table_close(...);
These should end with: "heap_freetuple(tuple);"
(ii) Typo "nuder" and grammar:
CURRENTLY:
There can be race condition: event trigger may be added after we have
scanned pg_event_trigger table. Repeat this test nuder pg_database
table lock.
SUGGEST:
There can be a race condition: the event trigger may be added after we
have scanned the pg_event_trigger table. Repeat this test under the
pg_database table lock.
(6) src/backend/utils/misc/postgresql.conf.sample
CURRENTLY:
+#enable_client_connection_trigger = true # enables firing the
client_connection trigger when a client connect
SUGGEST:
+#enable_client_connection_trigger = true # enables firing the
client_connection trigger when a client connects
Regards,
Greg Nancarrow
Fujitsu Australia
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