Re: Typo about the SetDatatabaseHasLoginEventTriggers?

2024-04-17 Thread Japin Li


On Wed, 17 Apr 2024 at 14:10, Michael Paquier  wrote:
> On Tue, Apr 16, 2024 at 03:31:49PM +0900, Michael Paquier wrote:
>> Indeed, thanks!  Will fix and double-check the surroundings.
>
> And fixed this one.

Thanks for the pushing!

--
Regards,
Japin Li




Re: Typo about the SetDatatabaseHasLoginEventTriggers?

2024-04-17 Thread Michael Paquier
On Tue, Apr 16, 2024 at 03:31:49PM +0900, Michael Paquier wrote:
> Indeed, thanks!  Will fix and double-check the surroundings.

And fixed this one.
--
Michael


signature.asc
Description: PGP signature


Re: Typo about the SetDatatabaseHasLoginEventTriggers?

2024-04-16 Thread Michael Paquier
On Tue, Apr 16, 2024 at 02:05:46PM +0800, Japin Li wrote:
> Upon reviewing the login event trigger, I noticed a potential typo about
> the SetDatabaseHasLoginEventTriggers function name.

Indeed, thanks!  Will fix and double-check the surroundings.
--
Michael


signature.asc
Description: PGP signature


Typo about the SetDatatabaseHasLoginEventTriggers?

2024-04-16 Thread Japin Li


Hi,

Upon reviewing the login event trigger, I noticed a potential typo about
the SetDatabaseHasLoginEventTriggers function name.

diff --git a/src/backend/commands/event_trigger.c 
b/src/backend/commands/event_trigger.c
index 0d3214df9c..7a5ed6b985 100644
--- a/src/backend/commands/event_trigger.c
+++ b/src/backend/commands/event_trigger.c
@@ -111,7 +111,7 @@ static void validate_table_rewrite_tags(const char 
*filtervar, List *taglist);
 static void EventTriggerInvoke(List *fn_oid_list, EventTriggerData *trigdata);
 static const char *stringify_grant_objtype(ObjectType objtype);
 static const char *stringify_adefprivs_objtype(ObjectType objtype);
-static void SetDatatabaseHasLoginEventTriggers(void);
+static void SetDatabaseHasLoginEventTriggers(void);

 /*
  * Create an event trigger.
@@ -315,7 +315,7 @@ insert_event_trigger_tuple(const char *trigname, const char 
*eventname, Oid evtO
 * faster lookups in hot codepaths. Set the flag unless already True.
 */
if (strcmp(eventname, "login") == 0)
-   SetDatatabaseHasLoginEventTriggers();
+   SetDatabaseHasLoginEventTriggers();

/* Depend on owner. */
recordDependencyOnOwner(EventTriggerRelationId, trigoid, evtOwner);
@@ -383,7 +383,7 @@ filter_list_to_array(List *filterlist)
  * current database has on login event triggers.
  */
 void
-SetDatatabaseHasLoginEventTriggers(void)
+SetDatabaseHasLoginEventTriggers(void)
 {
/* Set dathasloginevt flag in pg_database */
Form_pg_database db;
@@ -453,7 +453,7 @@ AlterEventTrigger(AlterEventTrigStmt *stmt)
 */
if (namestrcmp(>evtevent, "login") == 0 &&
tgenabled != TRIGGER_DISABLED)
-   SetDatatabaseHasLoginEventTriggers();
+   SetDatabaseHasLoginEventTriggers();

InvokeObjectPostAlterHook(EventTriggerRelationId,
  trigoid, 0);
@@ -925,7 +925,7 @@ EventTriggerOnLogin(void)
/*
 * There is no active login event trigger, but our
 * pg_database.dathasloginevt is set. Try to unset this flag.  We use 
the
-* lock to prevent concurrent SetDatatabaseHasLoginEventTriggers(), but 
we
+* lock to prevent concurrent SetDatabaseHasLoginEventTriggers(), but we
 * don't want to hang the connection waiting on the lock.  Thus, we are
 * just trying to acquire the lock conditionally.
 */
--
Regards,
Japin Li