Re: system catalog and varchar datatype

From: Oliver Elphick <olly(at)lfix(dot)co(dot)uk>
To: sandra ruiz <mileruiz(at)hotmail(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: system catalog and varchar datatype
Date: 2004-07-19 21:26:16
Message-ID: 1090272376.25749.139.camel@linda
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Mon, 2004-07-19 at 21:58, sandra ruiz wrote:
> hi, I need to find out the length of a varchar attribute ..
>
> for example,if a I have an atribute "description varchar(256)" I would
> expect to see this "256" in the pg_attribute table.
>
> there's is an "attlen" In the pg_attribute but this doesn't give any
> information

SELECT pg_catalog.format_type(a.atttypid, a.atttypmod)
FROM pg_attribute AS a;

would return "character varying(10)" or similar.

--
Oliver Elphick olly(at)lfix(dot)co(dot)uk
Isle of Wight http://www.lfix.co.uk/oliver
GPG: 1024D/A54310EA 92C8 39E7 280E 3631 3F0E 1EC0 5664 7A2F A543 10EA
========================================
"Blessed is the man that trusteth in the LORD, and
whose hope the LORD is." Jeremiah 17:7

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Stephan Szabo 2004-07-19 21:31:30 Re: system catalog and varchar datatype
Previous Message sandra ruiz 2004-07-19 20:58:08 system catalog and varchar datatype