pg_type populated incorrectly in some cases? - Mailing list pgsql-hackers

From Maurice Gittens
Subject pg_type populated incorrectly in some cases?
Date
Msg-id 199804080856.KAA08382@david.gits.nl
Whole thread Raw
Responses Re: [HACKERS] pg_type populated incorrectly in some cases?
List pgsql-hackers
Hi,

In include/catalog/pg_type.h I've noticed the following code.

<Code>
CATALOG(pg_type) BOOTSTRAP
{
    NameData    typname;
    Oid            typowner;
    int2        typlen;

    /*
     * typlen is the number of bytes we use to represent a value of this
     * type, e.g. 4 for an int4.  But for a variable length type, typlen
     * is -1.

    ...
</Code>

The pg_type catalog is then populated with lines like the following.

<Code>
DATA(insert OID = 71 (    pg_type         PGUID 1 1 t b t \054 1247 0 foo bar foo bar c _null_));
DATA(insert OID = 75 (    pg_attribute PGUID 1 1 t b t \054 1249 0 foo bar foo bar c _null_));
DATA(insert OID = 81 (    pg_proc         PGUID 1 1 t b t \054 1255 0 foo bar foo bar c _null_));
DATA(insert OID = 83 (    pg_class     PGUID 1 1 t b t \054 1259 0 foo bar foo bar c _null_));

</Code>

Notice that the type length for types like pg_class have the value of one (1)?
I would have expected them to the same length as an oid.
Am I just seeing things?

Thanks with regards from Maurice


pgsql-hackers by date:

Previous
From: Dwight Johnson
Date:
Subject: Re: [QUESTIONS] warning: tcl support disabled
Next
From: "Thomas G. Lockhart"
Date:
Subject: HAVING clause