Re: weird objectaddress.c entry for transforms

From: Andres Freund <andres(at)anarazel(dot)de>
To: pgsql-hackers(at)postgresql(dot)org, Peter Eisentraut <peter_e(at)gmx(dot)net>, Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
Subject: Re: weird objectaddress.c entry for transforms
Date: 2018-11-20 01:56:20
Message-ID: 20181120015620.gur2wnud5od7obno@alap3.anarazel.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 2018-11-19 17:53:22 -0800, Andres Freund wrote:
> Hi Peter, Alvaro, All,
>
> (Peter, this is your change, Alvaro, you're the objectaddress.c master)
>
> While looking through my oids removal patch I noticed that the
> objectaddress.c ObjectProperty entry for transforms looks wrong:
>
> typedef struct
> {
> Oid class_oid; /* oid of catalog */
> Oid oid_index_oid; /* oid of index on system oid column */
> int oid_catcache_id; /* id of catcache on system oid column */
> int name_catcache_id; /* id of catcache on (name,namespace), or
> * (name) if the object does not live in a
> * namespace */
> AttrNumber attnum_name; /* attnum of name field */
> AttrNumber attnum_namespace; /* attnum of namespace field */
> AttrNumber attnum_owner; /* attnum of owner field */
> AttrNumber attnum_acl; /* attnum of acl field */
> ObjectType objtype; /* OBJECT_* of this object type */
> bool is_nsp_name_unique; /* can the nsp/name combination (or name
> * alone, if there's no namespace) be
> * considered a unique identifier for an
> * object of this class? */
> } ObjectPropertyType;
>
> {
> TransformRelationId,
> TransformOidIndexId,
> TRFOID,
> InvalidAttrNumber,
> },
>
> this was added in https://git.postgresql.org/gitweb/?p=postgresql.git;a=commit;h=cac76582053e
>
> The InvalidAttrNumber entry initializes the member for name_catcache_id,
> instead of -1 as the other entries, and in contrast to the rest of the
> entries it doesn't initialize the other fields. In particular objtype is
> 0 instead of -1 as the rest.

Also, uh, shouldn't this actually fill out some of those fields? Most of
them actually apply to transforms.

Greetings,

Andres Freund

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Michael Paquier 2018-11-20 02:07:16 Re: More issues with pg_verify_checksums and checksum verification in base backups
Previous Message Andres Freund 2018-11-20 01:53:22 weird objectaddress.c entry for transforms