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

From Markus Schaber
Subject Re: Field length ??
Date
Msg-id 4447515C.5070601@logix-tt.com
Whole thread Raw
In response to Re: Field length ??  (Louise Catherine <r1c4n@yahoo.com>)
Responses Re: Field length ??  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: Field length ??  (Frank Bax <fbax@sympatico.ca>)
List 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


pgsql-sql by date:

Previous
From: Mariya Yuniarti
Date:
Subject: ask syntax sql to get length of field
Next
From: "Florian Reiser"
Date:
Subject: Re: Moving around in a SQL database