Re: [PATCH] Re: pg_identify_object_as_address() doesn't support pg_event_trigger oids

From: Japin Li <japinli(at)hotmail(dot)com>
To: Joel Jacobson <joel(at)compiler(dot)org>
Cc: Michael Paquier <michael(at)paquier(dot)xyz>, Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>, pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: [PATCH] Re: pg_identify_object_as_address() doesn't support pg_event_trigger oids
Date: 2021-04-27 05:46:41
Message-ID: MEYP282MB166956B48A14210C4A0C05F1B6419@MEYP282MB1669.AUSP282.PROD.OUTLOOK.COM
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


On Tue, 27 Apr 2021 at 13:16, Joel Jacobson <joel(at)compiler(dot)org> wrote:
> On Mon, Apr 26, 2021, at 10:30, Michael Paquier wrote:
>> On Fri, Apr 23, 2021 at 09:33:36AM +0200, Joel Jacobson wrote:
>> > Also, since this is a problem also in v13 maybe this should also be
>> > back-ported? I think it's a bug since both
>> > pg_identify_object_as_address() and event triggers exists in v13, so
>> > the function should work there as well, otherwise users would need
>> > to do work-arounds for event triggers.
>>
>> No objections from here to do something in back-branches. We cannot
>> have a test for event triggers in object_address.sql and it would be
>> better to keep it in a parallel set (see 676858b for example). Could
>> you however add a small test for that in event_trigger.sql? It would
>> be good to check after all three functions pg_identify_object(),
>> pg_identify_object_as_address() and pg_get_object_address().
>> --
>> Michael
>
> Thanks for the guidance in how to test.
>
> I've added a test at the end of event_trigger.sql,
> reusing the three event triggers already in existence,
> just before they are dropped.
>
> New patch attached.

IMO we should add a space between the parameters to keep the code
style consistently.

+SELECT
+ evtname,
+ pg_describe_object('pg_event_trigger'::regclass,oid,0),
+ pg_identify_object('pg_event_trigger'::regclass,oid,0),
+ pg_identify_object_as_address('pg_event_trigger'::regclass,oid,0)
+FROM pg_event_trigger
+WHERE evtname IN ('start_rls_command','end_rls_command','sql_drop_command')
+ORDER BY evtname;

--
Regrads,
Japin Li.
ChengDu WenWu Information Technology Co.,Ltd.

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Fujii Masao 2021-04-27 05:49:54 Re: TRUNCATE on foreign table
Previous Message Bharath Rupireddy 2021-04-27 05:37:18 Re: Skip temporary table schema name from explain-verbose output.