Re: Array elements (urgent help needed) - Mailing list pgsql-interfaces

From Tom Lane
Subject Re: Array elements (urgent help needed)
Date
Msg-id 14101.1097255879@sss.pgh.pa.us
Whole thread Raw
In response to Re: Array elements (urgent help needed)  (Akbar Mokhtarani <akbarm@slac.stanford.edu>)
List pgsql-interfaces
Akbar Mokhtarani <akbarm@slac.stanford.edu> 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


pgsql-interfaces by date:

Previous
From: Akbar Mokhtarani
Date:
Subject: Re: Array elements (urgent help needed)
Next
From: "Israel Urquieta Vargas"
Date:
Subject: PGacces