Re: pg_identify_object_as_address() doesn't support pg_event_trigger oids

From: "Joel Jacobson" <joel(at)compiler(dot)org>
To: "Alvaro Herrera" <alvherre(at)alvh(dot)no-ip(dot)org>
Cc: pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: pg_identify_object_as_address() doesn't support pg_event_trigger oids
Date: 2021-04-23 06:54:45
Message-ID: 66cb72ba-29af-469e-9961-810a8425b097@www.fastmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, Apr 22, 2021, at 19:32, Alvaro Herrera wrote:
> On 2021-Apr-22, Joel Jacobson wrote:
> > SELECT * FROM pg_identify_object_as_address('pg_event_trigger'::regclass,289361636,0);
> > ERROR: requested object address for unsupported object class 32: text result "ddl_postgrest"
>
> Hmm, I think this is an accidental omission and it should be supported.

Oh, I realise now the error came from a server running v13,
but there seems to be a problem in HEAD as well;
the "object_names" text[] output is empty for event triggers,
so the output will be the same for all event triggers,
which doesn't seem right since the output should be unique.

The output from the other functions pg_describe_object() and pg_identify_object()
contain the name in the output though.

Example:

SELECT
*,
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;
-[ RECORD 1 ]-----------------+-----------------------------------------------
oid | 396715
evtname | ddl_postgrest
evtevent | ddl_command_end
evtowner | 10
evtfoid | 396714
evtenabled | O
evttags |
pg_describe_object | event trigger ddl_postgrest
pg_identify_object | ("event trigger",,ddl_postgrest,ddl_postgrest)
pg_identify_object_as_address | ("event trigger",{},{})

I therefore think the evtname should be added to object_names.

/Joel

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message wangyukun@fujitsu.com 2021-04-23 07:03:40 RE: fix a comment
Previous Message Fujii Masao 2021-04-23 06:53:02 Re: Stale description for pg_basebackup