Re: system catalog and varchar datatype

From: Stephan Szabo <sszabo(at)megazone(dot)bigpanda(dot)com>
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:31:30
Message-ID: 20040719142656.Y95062@megazone.bigpanda.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Mon, 19 Jul 2004, 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

Atttypmod gives this information, but the value is datatype specific.

For varchar (and char) at least, the atttypmod is 4 greater than the
maximum length, so atttypmod for the above would be 260.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tony Li 2004-07-19 22:41:21 Re: system catalog and varchar datatype
Previous Message Oliver Elphick 2004-07-19 21:26:16 Re: system catalog and varchar datatype