varchar size

Andy Farrell <andy_farrell@gator-gate.itd.sterling.com>

From: "Andy Farrell" <Andy_Farrell@gator-gate.itd.sterling.com>
To: "PostGreSQL Hackers" <pgsql-hackers@postgresql.org>
Date: 1998-03-24T13:23:08Z
Lists: pgsql-hackers
REGARDING                varchar size

Given the results of a query using the perl interface to postgres, how can I
find the maximum length of the data returned for the varchar fields in the
query?

Is there something in the "results" buffer or can I query the system catalogs
for this information?  If you need to query the system catalogs, what field
actually contains the maximum length of a varchar field?  In other words, how
can I find what the field was defined as in the create table statement (e.g.,
...attribute1  varchar(12)...) using the system catalogs?

TIA,
Andy