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 16909.1213107791@sss.pgh.pa.us
Whole thread Raw
In response to Re: libpq support for arrays and composites  ("Merlin Moncure" <mmoncure@gmail.com>)
Responses Re: libpq support for arrays and composites  ("Merlin Moncure" <mmoncure@gmail.com>)
List pgsql-hackers
"Merlin Moncure" <mmoncure@gmail.com> writes:
> On 6/8/08, Andrew Dunstan <andrew@dunslane.net> wrote:
>> Tom Lane wrote:
>>> Are you intending that these operations support both text and binary
>>> results?
>> 
>> I'm a bit open on that.

> IMO, support for binary is critical.  Because of the interplay of the
> array and composite out formats, the number of backslashes grows
> exponentially (!) with nesting levels.  This makes text format arrays
> unsuitable for any non-trivial operations involving arrays of
> composites.

Um ... but who cares, as long as you've got functions to wrap and unwrap
the data for you?  Personally I wouldn't object if these were text-only;
they'd be a whole lot more future-proof that way.

> One alternative is to do a MAXDIM (6) argument 'getter' also taking
> the requested dimension with perhaps some wrapping macros for
> simplicity.  One issue with this is that it seems to suggest array
> slicing etc. which seems more complicated than it's worth.

Let's not embed MAXDIM in libpq's ABI :-(
        regards, tom lane


pgsql-hackers by date:

Previous
From: "Merlin Moncure"
Date:
Subject: Re: libpq support for arrays and composites
Next
From: Tom Lane
Date:
Subject: Re: RFD: ALTER COLUMN .. SET STORAGE COMPRESSED;