Re: [PATCH] Add pg_get_trigger_ddl() to retrieve the CREATE TRIGGER statement

From: Philip Alger <paalger0(at)gmail(dot)com>
To: jian he <jian(dot)universality(at)gmail(dot)com>
Cc: Jim Jones <jim(dot)jones(at)uni-muenster(dot)de>, Andrew Dunstan <andrew(at)dunslane(dot)net>, Cary Huang <cary(dot)huang(at)highgo(dot)ca>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [PATCH] Add pg_get_trigger_ddl() to retrieve the CREATE TRIGGER statement
Date: 2025-10-22 17:14:48
Message-ID: CAPXBC8LFeU1ZDFGARLmeZc15GYudVD9_gapGk1vta5boAWmOtg@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi Jian,

> 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');

That's correct. The function wouldn't produce that output though.

+ nameList = textToQualifiedNameList(trgName);
> + DeconstructQualifiedName(nameList, &schemaName, &objName);
>
> So the above ``textToQualifiedNameList(trgName);`` part is wrong?
>

I am handling quoted trigger names. Is that wrong?

--
Best,
Phil Alger

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Matheus Alcantara 2025-10-22 17:25:36 Re: LISTEN/NOTIFY bug: VACUUM sets frozenxid past a xid in async queue
Previous Message Nathan Bossart 2025-10-22 16:36:01 Re: abi-compliance-check failure due to recent changes to pg_{clear,restore}_{attribute,relation}_stats()