weird objectaddress.c entry for transforms - Mailing list pgsql-hackers

From Andres Freund
Subject weird objectaddress.c entry for transforms
Date
Msg-id 20181120015322.iwron4ss4t6r3yms@alap3.anarazel.de
Whole thread Raw
Responses Re: weird objectaddress.c entry for transforms
List pgsql-hackers
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.

Greetings,

Andres Freund


pgsql-hackers by date:

Previous
From: Stephen Frost
Date:
Subject: Re: More issues with pg_verify_checksums and checksum verificationin base backups
Next
From: Andres Freund
Date:
Subject: Re: weird objectaddress.c entry for transforms