agora inbox for [email protected]  
help / color / mirror / Atom feed
From: Andrew Chernow <[email protected]>
To: John Lister <[email protected]>
Cc: [email protected]
Subject: Re: Array types
Date: Wed, 08 Apr 2009 11:07:39 -0400
Message-ID: <[email protected]> (raw)
In-Reply-To: <[email protected]>
References: <[email protected]>
	<[email protected]>
	<[email protected]>

Andrew Chernow wrote:
> John Lister wrote:
>> Following this up, is there any docs on the binary wire format for 
>> arrays?
>>  
> 
> None that I know of.
> 
> Check out the backend source: (array_recv() and array_send() functions)
> http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/utils/adt/arrayfuncs.c?rev=1.154 
> 
> 
> Or, look at libpqtypes array.c:
> http://libpqtypes.esilo.com/browse_source.html?file=array.c
> 

Forgot to mention, this is not as simple as understanding the array 
format.  You have to understand the wire format for all types that can 
be array elements.  The array wire format serializes its array elements 
as [elem_len][elem_data].  elem_data is the wire format of the array 
element type, like an int, timestamp, polygon, bytea, etc...  So once 
you unravel the array container format, you still have to demarshal the 
type data.

-- 
Andrew Chernow
eSilo, LLC
every bit counts
http://www.esilo.com/



view thread (24+ messages)  latest in thread

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: [email protected]
  Cc: [email protected], [email protected]
  Subject: Re: Array types
  In-Reply-To: <[email protected]>

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

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