Re: Field length ?? - Mailing list pgsql-sql

From Tom Lane
Subject Re: Field length ??
Date
Msg-id 18166.1145543229@sss.pgh.pa.us
Whole thread Raw
In response to Re: Field length ??  (Markus Schaber <schabi@logix-tt.com>)
List pgsql-sql
Markus Schaber <schabi@logix-tt.com> writes:
> Louise Catherine wrote:
>> Could anyone explain, why the field length must be add by 4 :

> I guess that it is because all variable length datatypes (and text types
> are such) internally contain a 4 bytes length field.

It's an ancient decision that no longer has much of anything to do with
reality, but changing it would break more code than it's worth to have
a slightly cleaner definition of atttypmod ...
        regards, tom lane


pgsql-sql by date:

Previous
From: "John Goss"
Date:
Subject: At time zone madness!
Next
From: Bruno Wolff III
Date:
Subject: Re: ask syntax sql to get length of field