From: | Raghavendra <raghavendra(dot)rao(at)enterprisedb(dot)com> |
---|---|
To: | shuaixf <shuaixf(at)gmail(dot)com> |
Cc: | pgsql-admin(at)postgresql(dot)org |
Subject: | Re: how can I get the length of columns of a table by system tables/views |
Date: | 2011-09-09 07:41:06 |
Message-ID: | CA+h6AhhcnXmvDPXk2XzqRY8W7J+WKmALSen_rMcXT_38=P3_Sw@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-admin |
>
> For example:
CREATE TABLE tb(name varchar(32));
You can get this with System functions.
select pg_column_size(name) from tb;
---
Regards,
Raghavendra
EnterpriseDB Corporation
Blog: http://raghavt.blogspot.com/
On Wed, Sep 7, 2011 at 8:50 PM, shuaixf <shuaixf(at)gmail(dot)com> wrote:
>
> According to pg_class, pg_attribute, pg_type, I can get the tablename,
> column name, column type
> however, how to get the length of columns of a table by system
> tables/views?
> Thanks!
>
> --
> 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-tp4778911p4778911.html
> Sent from the PostgreSQL - admin mailing list archive at Nabble.com.
>
> --
> Sent via pgsql-admin mailing list (pgsql-admin(at)postgresql(dot)org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-admin
>
From | Date | Subject | |
---|---|---|---|
Next Message | marvin.deoliveira | 2011-09-09 12:05:58 | Foreign key without the column reference |
Previous Message | Bruce Momjian | 2011-09-08 20:13:21 | Re: pg_upgrade from 9.0 to 9.1 |