pg.ddx.io  pgsql-interfaces@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Akbar Mokhtarani <akbarm@slac.stanford.edu>
Cc: PostgreSQL-interfaces <pgsql-interfaces@postgresql.org>
Subject: Re: Array elements (urgent help needed)
Date: Fri, 08 Oct 2004 13:17:59 -0400
Message-ID: <14101.1097255879@sss.pgh.pa.us> (raw)
In-Reply-To: <Pine.LNX.4.58.0410081002170.27696@noric12.slac.stanford.edu>
References: <Pine.LNX.4.58.0410031950350.32241@noric03.slac.stanford.edu>
	<12088.1096864390@sss.pgh.pa.us>
	<Pine.LNX.4.58.0410081002170.27696@noric12.slac.stanford.edu>

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



view thread (6+ messages)

Message-ID: <14101.1097255879@sss.pgh.pa.us>
Permalink:  ../14101.1097255879@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/14101.1097255879@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-interfaces@postgresql.org
  Cc: tgl@sss.pgh.pa.us, akbarm@slac.stanford.edu
  Subject: Re: Array elements (urgent help needed)
  In-Reply-To: <14101.1097255879@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox