Re: [PATCH] pgbench - refactor some connection finish/null into common function

From: Andres Freund <andres(at)anarazel(dot)de>
To: "Rady, Doug" <radydoug(at)amazon(dot)com>
Cc: Fabien COELHO <coelho(at)cri(dot)ensmp(dot)fr>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [PATCH] pgbench - refactor some connection finish/null into common function
Date: 2018-03-01 09:05:42
Message-ID: 20180301090542.qslicc5inkufw3pu@alap3.anarazel.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 2018-02-21 19:11:15 +0000, Rady, Doug wrote:
>
> On 1/30/18, 03:41, "Fabien COELHO" <coelho(at)cri(dot)ensmp(dot)fr> wrote:
> Hello Doug,
> Hi Fabien,
>
> > This patch refactors all of the connection state PQfinish() and NULL’ing into a single function.
> > Excludes PQfinish() in doConnect().
>
> My 0.02€:
>
> The argument could be "PGconn **" instead of a "CState *"?
> If so, it may be used in a few more places. What is your opinion?
>
> I should have named finishCon() as finishCStateCon() since it was specific to that use pattern.
> I'll resubmit with that change if you think it helps.

I think the current name works well enough, and I think the PGconn **
version would be more complicated.

> I'm fine with this kind of factorization which takes out a three-line
> pattern, but I'm wondering whether it would please committers.
>
> Guess we'll find out ...

I would never have bothered on my own, but ...

Greetings,

Andres Freund

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Andres Freund 2018-03-01 09:17:57 Re: pgbench - test whether a variable exists
Previous Message Andres Freund 2018-03-01 08:57:44 Re: PATCH: pgbench - break out timing data for initialization phases