Re: pgbench - refactor init functions with buffers - Mailing list pgsql-hackers

From Fabien COELHO
Subject Re: pgbench - refactor init functions with buffers
Date
Msg-id alpine.DEB.2.21.1910221243311.15559@lancre
Whole thread Raw
In response to Re: pgbench - refactor init functions with buffers  (Jeevan Ladhe <jeevan.ladhe@enterprisedb.com>)
Responses Re: pgbench - refactor init functions with buffers
List pgsql-hackers
Hello Jeevan,

>> I haven't read the complete patch.  But, I have noticed that many
>> places you changed the variable declaration from c to c++ style (i.e
>> moved the declaration in the for loop).  IMHO, generally in PG, we
>> don't follow this convention.  Is there any specific reason to do
>> this?
>
> +1.

As I said, this C99 feature is already used extensively in pg sources, so 
it makes sense to use it when refactoring something and if appropriate, 
which IMO is the case here.

> The patch does not apply on master, needs rebase.

Hmmm. "git apply pgbench-buffer-1.patch" works for me on current master.

> Also, I got some whitespace errors.

It possible, but I cannot see any. Could you be more specific?

Many mailers do not conform to MIME and mess-up newlines when attachements 
are typed text/*, because MIME requires the mailer to convert those to 
crnl eol when sending and back to system eol when receiving, but few 
actually do it. Maybe the issue is really there.

> I think you can also refactor the function tryExecuteStatement(), and
> call your newly added function executeStatementExpect() by passing
> an additional flag something like "errorOK".

Indeed, good point.

-- 
Fabien.
Attachment

pgsql-hackers by date:

Previous
From: Amit Kapila
Date:
Subject: Re: Proposal: Make use of C99 designated initialisers fornulls/values arrays
Next
From: Pavel Stehule
Date:
Subject: Re: dropdb --force