Re: system catalog and varchar datatype - Mailing list pgsql-general

From Oliver Elphick
Subject Re: system catalog and varchar datatype
Date
Msg-id 1090272376.25749.139.camel@linda
Whole thread Raw
In response to system catalog and varchar datatype  ("sandra ruiz" <mileruiz@hotmail.com>)
List 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@lfix.co.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


pgsql-general by date:

Previous
From: "sandra ruiz"
Date:
Subject: system catalog and varchar datatype
Next
From: Stephan Szabo
Date:
Subject: Re: system catalog and varchar datatype