Re: libpq support for arrays and composites - Mailing list pgsql-hackers

From Tom Lane
Subject Re: libpq support for arrays and composites
Date
Msg-id 24946.1212970216@sss.pgh.pa.us
Whole thread Raw
In response to libpq support for arrays and composites  (Andrew Dunstan <andrew@dunslane.net>)
Responses Re: libpq support for arrays and composites  (Andrew Dunstan <andrew@dunslane.net>)
List pgsql-hackers
Andrew Dunstan <andrew@dunslane.net> writes:
> One complicating factor I see is that there is no protocol level support 
> for anything other than simple objects - each data value is simply a 
> stream of bytes of a known length. We would therefore need some pretty 
> robust processing to pick apart structured objects.

Well, it's not that hard, the quoting/escaping rules for array_out and
record_out are well defined.

Are you intending that these operations support both text and binary
results?

The array accessors with ... parameter lists strike me as a bit
dangerous, because there is no way at all to verify that the caller is
passing the expected number of dimensions.  Can't that be made tighter?
Also you need to spell out the error handling conventions for each of
these.

I think you missed some "free()" operations.

It might also be useful to provide some functions that form an array or
composite value from per-element strings, ie, the converse of the
de-construction routines.  Here I'd be happy to skip the binary case.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Andrew Dunstan
Date:
Subject: libpq support for arrays and composites
Next
From: Tom Lane
Date:
Subject: Re: pg_dump restore time and Foreign Keys