Received: from localhost (unknown [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id 6E3FE2E0074 for ; Fri, 29 Feb 2008 14:44:52 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 94736-03 for ; Fri, 29 Feb 2008 14:44:49 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey-1.7.5 Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by postgresql.org (Postfix) with ESMTP id 03BD52E00E6 for ; Fri, 29 Feb 2008 14:44:48 -0400 (AST) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.2/8.14.2) with ESMTP id m1TIiRgr010184; Fri, 29 Feb 2008 13:44:27 -0500 (EST) To: Kris Jurka cc: dmp , pgsql-jdbc@postgresql.org Subject: Re: Array Char/VarChar Size In-reply-to: References: <47C512CA.9010808@ttc-cmc.net> <47C8419F.2060909@ttc-cmc.net> Comments: In-reply-to Kris Jurka message dated "Fri, 29 Feb 2008 12:53:57 -0500" Date: Fri, 29 Feb 2008 13:44:27 -0500 Message-ID: <10183.1204310667@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200802/208 X-Sequence-Number: 18415 Kris Jurka writes: > Multi-dimensional array information is not stored. Every array type may > be any number of dimensions. The precision information is not available > in the information_schema, but it is available in the system catalog > tables. See pg_attribute.atttypmod, but it does require some decoding. Rather than embedding knowledge of typmod encoding in client-side code, may I suggest using the format_type function? For example select format_type(atttypid, atttypmod) from pg_attribute where attrelid = 'my_table'::regclass and attname = 'my_column'; This will give you back something reasonably standardized, like "character varying(42)[]". You'll still need a bit of logic to extract what you want, but it seems much less likely to break. regards, tom lane