Re: Field length ??

From: Markus Schaber <schabi(at)logix-tt(dot)com>
To: Louise Catherine <r1c4n(at)yahoo(dot)com>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: Field length ??
Date: 2006-04-20 09:16:12
Message-ID: 4447515C.5070601@logix-tt.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

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.

http://www.postgresql.org/docs/8.1/interactive/xtypes.html might be a
start if you want to read more on this topic.

HTH,
Markus

--
Markus Schaber | Logical Tracking&Tracing International AG
Dipl. Inf. | Software Development GIS

Fight against software patents in EU! www.ffii.org www.nosoftwarepatents.org

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Christian Paul B. Cosinas 2006-04-20 11:42:24 Programatically Backup Database Using Visual Basic
Previous Message Mariya Yuniarti 2006-04-20 07:37:08 ask syntax sql to get length of field