Re: how can I get the length of columns of a table by system tables/views - Mailing list pgsql-sql

From shuaixf
Subject Re: how can I get the length of columns of a table by system tables/views
Date
Msg-id 1315572818036-4786248.post@n5.nabble.com
Whole thread Raw
Responses Re: Re: how can I get the length of columns of a table by system tables/views
List pgsql-sql
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 lower(pg_namespace.nspname) = 'public')
          WHERE pg_class.relname='tablename') AND a.attnum > 0 AND NOT a.attisdropped
 
ORDER BY a.attnum;

--
View this message in context:
http://postgresql.1045698.n5.nabble.com/how-can-I-get-the-length-of-columns-of-a-table-by-system-tables-views-tp4780987p4786248.html
Sent from the PostgreSQL - sql mailing list archive at Nabble.com.


pgsql-sql by date:

Previous
From: Waqar Azeem
Date:
Subject: Re: My Trigger is not working :(
Next
From: msi77
Date:
Subject: Re: Re: how can I get the length of columns of a table by system tables/views