Re: new version of PQconnectdb was:(Re: [HACKERS] Determining client_encoding from client locale)

From: Andrew Chernow <ac(at)esilo(dot)com>
To: Jaime Casanova <jcasanov(at)systemguards(dot)com(dot)ec>
Cc: Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>, pgsql-hackers(at)postgresql(dot)org, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Bruce Momjian <bruce(at)momjian(dot)us>, Itagaki Takahiro <itagaki(dot)takahiro(at)oss(dot)ntt(dot)co(dot)jp>, Peter Eisentraut <peter_e(at)gmx(dot)net>
Subject: Re: new version of PQconnectdb was:(Re: [HACKERS] Determining client_encoding from client locale)
Date: 2009-09-14 18:34:55
Message-ID: 4AAE8CCF.9070808@esilo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Jaime Casanova wrote:
> On Thu, Sep 10, 2009 at 12:01 AM, Jaime Casanova
> <jcasanov(at)systemguards(dot)com(dot)ec> wrote:
>> On Mon, Jul 6, 2009 at 10:00 AM, Heikki
>> Linnakangas<heikki(dot)linnakangas(at)enterprisedb(dot)com> wrote:
>>> Could we
>>> have a version of PQconnectdb() with an API more suited for setting the
>>> params programmatically? The PQsetdbLogin() approach doesn't scale as
>>> parameters are added/removed in future versions, but we could have
>>> something like this:
>>>
>>> PGconn *PQconnectParams(const char **params)
>>>
>>> Where "params" is an array with an even number of parameters, forming
>>> key/value pairs. Usage example:
>>>
>
> i extracted the functions to connect that Heikki put on psql in his
> patch for determining client_encoding from client locale and put it in
> libpq so i follow the PQconnectdbParams(* params[]) approach.

I was following this and never saw any firm decision on the prototype
for this function. Although, I can say the single argument version did
not appear to win any votes.

The below posts agreed on a two argument version of parallel arrays
(keywords, values):

http://archives.postgresql.org/pgsql-hackers/2009-09/msg00533.php
http://archives.postgresql.org/pgsql-hackers/2009-09/msg00559.php

There is also the idea of passing an array of structs floating around,
NULL terminated list or include an additional argument specifying
element count.

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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Emmanuel Cecchet 2009-09-14 18:41:33 Re: COPY enhancements
Previous Message Jaime Casanova 2009-09-14 18:23:17 Re: new version of PQconnectdb was:(Re: [HACKERS] Determining client_encoding from client locale)