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

From: jian he <jian(dot)universality(at)gmail(dot)com>
To: Philip Alger <paalger0(at)gmail(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: [PATCH] Add pg_get_trigger_ddl() to retrieve the CREATE TRIGGER statement
Date: 2025-10-16 07:52:16
Message-ID: CACJufxGbE4uJWu1YuqdmOx+7PMBpHvX_fbRMmHu=r4SrsuW9tg@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, Oct 14, 2025 at 9:14 PM Philip Alger <paalger0(at)gmail(dot)com> wrote:
>
>> select pg_get_trigger_ddl(-1, 'h');
>> ERROR: relation with OID 4294967295 does not exist
>>
>> this error obviously is not good.
>> we can follow the approach used by pg_get_viewdef(oid)
>
> But isn't that an edge case? Would a user really pass in an arbitrary number like -1? That seems counterintuitive.
>

hi.

I complained the same issue for pg_basetype at
https://www.postgresql.org/message-id/3759807.1711658868%40sss.pgh.pa.us

maybe we can return NULL for
select pg_get_trigger_ddl(-1, 'h');

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Matěj Klonfar 2025-10-16 08:06:24 Re: [PROPOSAL] comments in repl_scanner
Previous Message jian he 2025-10-16 07:43:49 refactor func-matching.sgml, make regexp* function more readable