Received: from maia.hub.org (maia-5.hub.org [200.46.204.29]) by mail.postgresql.org (Postfix) with ESMTP id D7EEFB5DC69 for ; Fri, 9 Sep 2011 09:53:44 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.29]) (amavisd-maia, port 10024) with ESMTP id 56176-09 for ; Fri, 9 Sep 2011 12:53:38 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from sam.nabble.com (sam.nabble.com [216.139.236.26]) by mail.postgresql.org (Postfix) with ESMTP id 6AE52B5D80A for ; Fri, 9 Sep 2011 09:53:38 -0300 (ADT) Received: from [192.168.236.26] (helo=sam.nabble.com) by sam.nabble.com with esmtp (Exim 4.72) (envelope-from ) id 1R20aQ-0000Qc-1N for pgsql-sql@postgresql.org; Fri, 09 Sep 2011 05:53:38 -0700 Date: Fri, 9 Sep 2011 05:53:38 -0700 (PDT) From: shuaixf To: pgsql-sql@postgresql.org Message-ID: <1315572818036-4786248.post@n5.nabble.com> In-Reply-To: <1315451354762-4780987.post@n5.nabble.com> References: <1315451354762-4780987.post@n5.nabble.com> Subject: Re: how can I get the length of columns of a table by system tables/views MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-0.767 tagged_above=-5 required=5 tests=BAYES_00=-1.9, FREEMAIL_FROM=0.001, T_TO_NO_BRKTS_FREEMAIL=0.01, URI_HEX=1.122 X-Spam-Level: X-Archive-Number: 201109/15 X-Sequence-Number: 35815 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.