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 via email to