Re: [PATCH] Add pg_get_trigger_ddl() to retrieve the CREATE TRIGGER statement
| От | jian he |
|---|---|
| Тема | Re: [PATCH] Add pg_get_trigger_ddl() to retrieve the CREATE TRIGGER statement |
| Дата | |
| Msg-id | CACJufxErnfjjxYnNvWaEVu2nb_7XG7zgQZiHhzwNX8e89S=CvA@mail.gmail.com обсуждение исходный текст |
| Ответ на | Re: [PATCH] Add pg_get_trigger_ddl() to retrieve the CREATE TRIGGER statement (Philip Alger <paalger0@gmail.com>) |
| Ответы |
Re: [PATCH] Add pg_get_trigger_ddl() to retrieve the CREATE TRIGGER statement
|
| Список | 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 по дате отправления: