Received: from golem.jpl.nasa.gov (root@hectic-1.jpl.nasa.gov [128.149.68.203]) by hub.org (8.8.8/8.8.8) with ESMTP id UAA19599; Sun, 4 Oct 1998 20:56:23 -0400 (EDT) (envelope-from lockhart@alumni.caltech.edu) Received: from alumni.caltech.edu (localhost [127.0.0.1]) by golem.jpl.nasa.gov (8.8.5/8.8.5) with ESMTP id AAA05922; Mon, 5 Oct 1998 00:57:02 GMT Sender: tgl@mythos.jpl.nasa.gov Message-ID: <3618195E.6FE14EF6@alumni.caltech.edu> Date: Mon, 05 Oct 1998 00:57:02 +0000 From: "Thomas G. Lockhart" Organization: Caltech/JPL X-Mailer: Mozilla 4.05 [en] (X11; I; Linux 2.0.30 i686) MIME-Version: 1.0 To: Tom Lane CC: pgsql-hackers@postgreSQL.org, pgsql-interfaces@postgreSQL.org Subject: Re: [HACKERS] TCL_ARRAYS code in libpgtcl is pretty seriously broken References: <19449.907539856@sss.pgh.pa.us> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit > 1. Blithely assumes that any data value beginning with '{' and ending > with '}' must represent an array value. Should have some more robust > way of discovering whether a column is array type. (In fairness, this > might require a FE/BE protocol change, unless arrayness can be > determined from the tuple descriptors provided by the backend, ie, > field type OID, size, and attmod. Anybody know a way to do that?) > Comments? Postgres seems to use a convention that a type name which starts with an underscore is the array type for the corresponding non-underscore, non-array type. Also, the typelem field in pg_type is non-zero for array types. This isn't a definitive answer and there may be another way to discover array-ness but it's where I would look. Not sure if you'd be happy having to do a select on pg_type for every query unless you're doing it already... - Tom