Skip site navigation (1) Skip section navigation (2)

Re: Correctly producing array literals for prepared statements

From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: Kenneth Marshall <ktm(at)rice(dot)edu>
Cc: Merlin Moncure <mmoncure(at)gmail(dot)com>, Peter Geoghegan <peter(dot)geoghegan86(at)gmail(dot)com>, PG Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Correctly producing array literals for prepared statements
Date: 2011-02-23 17:18:58
Message-ID: 4D654182.2000106@dunslane.net (view raw or flat)
Thread:
Lists: pgsql-hackers

On 02/23/2011 10:40 AM, Kenneth Marshall wrote:
>
>>> Can someone please point me in the direction of an established client
>>> library/driver where all corner cases are covered, or at least enough
>>> of them to produce a net gain in usefulness? There may well be
>>> additional subtleties that have not occurred to me.
>> yes: libpqtypes.  it manages everything in binary.  i've been thinking
>> for a while that libpqtypes could be wrapped with variadic templates
>> or other c++ trickery.  Because libpqtypes does everything in binary,
>> it completely sidesteps all the escaping nastiness.
>>
> Avoiding the escaping by using binary parameter transmission is
> the best method. Shameless plug: libpqtypes is great!
> I hope that it can be eventually included in the core distribution.
> It is not uncommon to get "It's an add-on package???" and avoidance
> of pieces outside of the standard dist regardless of its value.
>
>


Binary mode had serious limitations, such as portability.

We do need some support in libpq for constructing and deconstructing 
arrays (and probably for composites too, although that will be harder, I 
suspect).

cheers

andrew



In response to

Responses

pgsql-hackers by date

Next:From: Gurjeet SinghDate: 2011-02-23 17:49:28
Subject: Re: Fix for Index Advisor related hooks
Previous:From: Jaime CasanovaDate: 2011-02-23 17:09:15
Subject: Re: Synchronous standby

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group