Re: Array types - Mailing list pgsql-hackers

From Andrew Chernow
Subject Re: Array types
Date
Msg-id 49DCBDBB.9070303@esilo.com
Whole thread Raw
In response to Re: Array types  (Andrew Chernow <ac@esilo.com>)
List pgsql-hackers
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/


pgsql-hackers by date:

Previous
From: Kevin Field
Date:
Subject: Re: plpgsql debugger (pldbg) absent from 8.4?
Next
From: Merlin Moncure
Date:
Subject: Re: Array types