X-Original-To: pgsql-interfaces-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 83908329E3E for ; Fri, 8 Oct 2004 18:18:31 +0100 (BST) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 93313-05 for ; Fri, 8 Oct 2004 17:17:59 +0000 (GMT) Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by svr1.postgresql.org (Postfix) with ESMTP id 2455F329F70 for ; Fri, 8 Oct 2004 18:17:59 +0100 (BST) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.13.1/8.13.1) with ESMTP id i98HHxGD014102; Fri, 8 Oct 2004 13:17:59 -0400 (EDT) To: Akbar Mokhtarani Cc: PostgreSQL-interfaces Subject: Re: Array elements (urgent help needed) In-reply-to: References: <12088.1096864390@sss.pgh.pa.us> Comments: In-reply-to Akbar Mokhtarani message dated "Fri, 08 Oct 2004 10:08:16 -0700" Date: Fri, 08 Oct 2004 13:17:59 -0400 Message-ID: <14101.1097255879@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=1.1 tagged_above=0.0 required=5.0 tests=NO_DNS_FOR_FROM X-Spam-Level: * X-Archive-Number: 200410/17 X-Sequence-Number: 5112 Akbar Mokhtarani writes: * A standard varlena array has the following internal structure: This didn't quite agree with what I found but it gave me a starting point. That's because it's describing the *internal* structure. Since you're on 7.4, what you are actually seeing is the on-the-wire representation emitted by array_send(), which looks like: /* Send the array header information */ pq_sendint(&buf, ndim, 4); pq_sendint(&buf, v->flags, 4); pq_sendint(&buf, element_type, sizeof(Oid)); for (i = 0; i < ndim; i++) { pq_sendint(&buf, ARR_DIMS(v)[i], 4); pq_sendint(&buf, ARR_LBOUND(v)[i], 4); } /* Send the array elements using the element's own sendproc */ /* (so N element values in whatever the datatype format is) */ regards, tom lane