Re: Field length ??

From: Frank Bax <fbax(at)sympatico(dot)ca>
To: pgsql-sql(at)postgresql(dot)org
Subject: Re: Field length ??
Date: 2006-04-20 15:21:27
Message-ID: 5.2.1.1.0.20060420111921.00a5b920@pop6.sympatico.ca
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

At 05:16 AM 4/20/06, Markus Schaber wrote:

>Hi, Louise,
>
>Louise Catherine wrote:
>
> > Could anyone explain, why the field length must be add by 4 :
> > result 1 : 10 + 4 =14
> > result 2 : 5 + 4 = 9
>
>I guess that it is because all variable length datatypes (and text types
>are such) internally contain a 4 bytes length field.

Except that the original fields were neither variable length datatypes, not
type text.
create table test(]
satu char(10),
dua char(5)
);

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Bruno Wolff III 2006-04-20 15:23:48 Re: ask syntax sql to get length of field
Previous Message Tom Lane 2006-04-20 14:27:09 Re: Field length ??