From: Louise Catherine <r1c4n@yahoo.com>
To: pgsql-sql@postgresql.org
Subject: Re: Field length ??
Date: Wed, 19 Apr 2006 23:08:38 -0700 (PDT)
Message-ID: <20060420060838.46274.qmail@web33403.mail.mud.yahoo.com> (raw)
In-Reply-To: <20060420033202.50061.qmail@web33408.mail.mud.yahoo.com>
Hi ,
With this table :
create table test(
satu char(10),
dua char(5)
);
To get the field length, I use this query:
select atttypmod from pg_attribute where
attname='satu' and
attrelid=(select oid from pg_class where relname='test');
---> result 1 : 14
select atttypmod from pg_attribute where
attname='dua' and
attrelid=(select oid from pg_class where relname='test');
---> result 2 : 9
Could anyone explain, why the field length must be add by 4 :
result 1 : 10 + 4 =14
result 2 : 5 + 4 = 9
Could I use this query ? Is it valid?
select atttypmod-4 from pg_attribute where
attname='satu' and
attrelid=(select oid from pg_class where relname='test');
Thank's,
Rina
---------------------------------
How low will we go? Check out Yahoo! Messenger’s low PC-to-Phone call rates.
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: r1c4n@yahoo.com
Subject: Re: Field length ??
In-Reply-To: <20060420060838.46274.qmail@web33403.mail.mud.yahoo.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox