Re: [PATCH] Add pg_get_trigger_ddl() to retrieve the CREATE TRIGGER statement - Mailing list pgsql-hackers

From jian he
Subject Re: [PATCH] Add pg_get_trigger_ddl() to retrieve the CREATE TRIGGER statement
Date
Msg-id CACJufxErnfjjxYnNvWaEVu2nb_7XG7zgQZiHhzwNX8e89S=CvA@mail.gmail.com
Whole thread Raw
In response to Re: [PATCH] Add pg_get_trigger_ddl() to retrieve the CREATE TRIGGER statement  (Philip Alger <paalger0@gmail.com>)
Responses Re: [PATCH] Add pg_get_trigger_ddl() to retrieve the CREATE TRIGGER statement
List pgsql-hackers
On Sun, Oct 19, 2025 at 5:35 AM Philip Alger <paalger0@gmail.com> wrote:
>
> Attached is v7. Moved the `initStringInfo` as suggested and reran tests.
>
hi.

https://www.postgresql.org/docs/current/sql-createtrigger.html
the parameter section:
>>>>
The name to give the new trigger. This must be distinct from the name of any
other trigger for the same table. The name cannot be schema-qualified — the
trigger inherits the schema of its table
>>>>

doc said trigger name can not be schema-qualified,
we can not do:
CREATE TRIGGER public.modified_a BEFORE UPDATE OF a ON main_table
FOR EACH ROW WHEN (OLD.a <> NEW.a) EXECUTE PROCEDURE trigger_func('modified_a');


+ text    *trgName = PG_GETARG_TEXT_PP(1);
+ Oid     trgOid;
+ List   *nameList;
+ char *schemaName;
+ char *objName;
+
+
+ /* Parse the trigger name to handle quoted identifiers */
+ nameList = textToQualifiedNameList(trgName);
+ DeconstructQualifiedName(nameList, &schemaName, &objName);

So the above ``textToQualifiedNameList(trgName);`` part is wrong?



pgsql-hackers by date:

Previous
From: Shinya Kato
Date:
Subject: Add wal_fpi_bytes_[un]compressed to pg_stat_wal
Next
From: "Hayato Kuroda (Fujitsu)"
Date:
Subject: RE: POC: enable logical decoding when wal_level = 'replica' without a server restart