Why not to use information schema:
select column_name, character_maximum_length from information_schema.columns
where table_name ='table name'
09.09.2011, 16:53, "shuaixf" :
> SELECT a.attname, pg_catalog.format_type(a.atttypid, a.atttypmod)
> FROM pg_catalog.pg_attribute a
> WHERE a.attrelid =
SELECT a.attname, pg_catalog.format_type(a.atttypid, a.atttypmod)
FROM pg_catalog.pg_attribute a
WHERE a.attrelid = (SELECT pg_class.oid
FROM pg_class INNER JOIN pg_namespace
ON (pg_class.relnamespace = pg_namespace.oid
AND low