X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (mx2.hub.org [200.46.204.254]) by postgresql.org (Postfix) with ESMTP id 92D7C11F6C49 for ; Thu, 20 Apr 2006 06:15:59 -0300 (ADT) X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Score: -2.169 X-Spam-Level: X-Spam-Status: No, score=-2.169 required=5 tests=[AWL=0.295, BAYES_00=-2.599, FORGED_RCVD_HELO=0.135] Received: from postgresql.org ([200.46.204.71]) by localhost (mx2.hub.org [200.46.204.254]) (amavisd-new, port 10024) with ESMTP id 7gCjSnyLah+y for ; Thu, 20 Apr 2006 06:15:57 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey- Received: from mail.logix-tt.com (unknown [212.211.145.186]) by postgresql.org (Postfix) with ESMTP id 5B84A11F6C19 for ; Thu, 20 Apr 2006 06:15:56 -0300 (ADT) Received: from kingfisher.intern.logix-tt.com (T96ed.t.pppool.de [89.55.150.237]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.logix-tt.com (Postfix) with ESMTP id DF04B656CD; Thu, 20 Apr 2006 11:16:55 +0200 (CEST) Received: from [127.0.0.1] (localhost [127.0.0.1]) by kingfisher.intern.logix-tt.com (Postfix) with ESMTP id 273BD181C1F52; Thu, 20 Apr 2006 11:16:12 +0200 (CEST) Message-ID: <4447515C.5070601@logix-tt.com> Date: Thu, 20 Apr 2006 11:16:12 +0200 From: Markus Schaber Organization: Logical Tracking and Tracing International AG, Switzerland User-Agent: Debian Thunderbird 1.0.7 (X11/20051017) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Louise Catherine Cc: pgsql-sql@postgresql.org Subject: Re: Field length ?? References: <20060420060838.46274.qmail@web33403.mail.mud.yahoo.com> In-Reply-To: <20060420060838.46274.qmail@web33403.mail.mud.yahoo.com> X-Enigmail-Version: 0.93.0.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Archive-Number: 200604/135 X-Sequence-Number: 24944 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