Re: [HACKERS] pg_type populated incorrectly in some cases?

From: Bruce Momjian <maillist(at)candle(dot)pha(dot)pa(dot)us>
To: mgittens(at)david(dot)gits(dot)nl (Maurice Gittens)
Cc: hackers(at)postgreSQL(dot)org
Subject: Re: [HACKERS] pg_type populated incorrectly in some cases?
Date: 1998-04-27 03:17:24
Message-ID: 199804270317.XAA19761@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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
>
>
>

I believe these should be -1, and I have set them to that. typprtlen is
not used for any purpose currently, but it pads the other int2 field, so
it is not taking any space, and someday may be useful.

--
Bruce Momjian | 830 Blythe Avenue
maillist(at)candle(dot)pha(dot)pa(dot)us | Drexel Hill, Pennsylvania 19026
+ If your life is a hard drive, | (610) 353-9879(w)
+ Christ can be your backup. | (610) 853-3000(h)

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 1998-04-27 03:21:09 Re: [HACKERS] Agregates in update?
Previous Message Bruce Momjian 1998-04-27 03:05:02 Re: [HACKERS] postgres init script things solved