Re: [PATCH] Make pg_basebackup configure and start standby [Review]

From: Boszormenyi Zoltan <zb(at)cybertec(dot)at>
To: Peter Eisentraut <peter_e(at)gmx(dot)net>
Cc: Amit Kapila <amit(dot)kapila(at)huawei(dot)com>, 'Hans-Jürgen Schönig' <hs(at)cybertec(dot)at>, 'Pg Hackers' <pgsql-hackers(at)postgresql(dot)org>, Magnus Hagander <magnus(at)hagander(dot)net>, Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
Subject: Re: [PATCH] Make pg_basebackup configure and start standby [Review]
Date: 2012-10-04 11:17:49
Message-ID: 506D705D.20306@cybertec.at
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

2012-10-04 12:42 keltezéssel, Boszormenyi Zoltan írta:
> 2012-10-04 06:47 keltezéssel, Boszormenyi Zoltan írta:
>> 2012-10-04 05:24 keltezéssel, Peter Eisentraut írta:
>>> On Wed, 2012-10-03 at 18:15 +0200, Boszormenyi Zoltan wrote:
>>>> The second generation of this work is now attached and contains a new
>>>> feature as was discussed and suggested by Magnus Hagander, Fujii Masao
>>>> and Peter Eisentraut. So libpq has grown a new function:
>>>>
>>>> +/* return the connection options used by a live connection */
>>>> +extern PQconninfoOption *PQconninfo(PGconn *conn);
>>>>
>>>> This copies all the connection parameters back from the live PGconn
>>>> itself
>>>> so everything that's needed to connect is already validated.
>>> I don't like that this code maintains a second list of all possible
>>> libpq connection parameters.
>>
>> Where does it do that? In PQconninfo() itself? Why is it a problem?
>> Or to put it bluntly: the same problem is in fillPGconn() too, as it also
>> has the same set of parameters listed. So there is already code
>> that you don't like. :-)
>>
>> How about a static mapping between option names and
>> offsetof(struct pg_conn, member) values? This way both fillPGconn()
>> and PQconninfo() can avoid maintaining the list of parameter names.
>
> Did you think about something like the attached code?

Or rather this one, which fixes a bug so fillPGconn() and PQconninfo() are
symmetric and work for "requiressl".

>
> Best regards,
> Zoltán Böszörményi

--
----------------------------------
Zoltán Böszörményi
Cybertec Schönig & Schönig GmbH
Gröhrmühlgasse 26
A-2700 Wiener Neustadt, Austria
Web: http://www.postgresql-support.de
http://www.postgresql.at/

Attachment Content-Type Size
01-PQconninfo-v8.patch text/x-patch 16.2 KB
02-pg_basebackup-v5.patch text/x-patch 6.3 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Amit Kapila 2012-10-04 12:27:52 Re: BUG #7534: walreceiver takes long time to detect n/w breakdown
Previous Message Amit Kapila 2012-10-04 10:56:30 Re: Re: [WIP] Performance Improvement by reducing WAL for Update Operation