Re: pgbench stats per script & other stuff - Mailing list pgsql-hackers

From Fabien COELHO
Subject Re: pgbench stats per script & other stuff
Date
Msg-id alpine.DEB.2.10.1603041827490.11128@sto
Whole thread Raw
In response to Re: pgbench stats per script & other stuff  (Alvaro Herrera <alvherre@2ndquadrant.com>)
Responses Re: pgbench stats per script & other stuff
List pgsql-hackers
Hello Alvaro,

> I looked at 19.d and I think the design has gotten pretty convoluted.  I
> think we could simplify with the following changes:
>
> struct script_t gets a new member, of type Command **, which is
> initially null.
>
> function process_builtin receives the complete script_t (not individual
> memebers of it) constructs the Command ** array and puts it in
> script_t's new member; return value is the same script_t struct it got
> (except it's now augmented with the Command **array).
>
> function process_file constructs a new script_t from the string list,
> creates its Command **array just like process_builtin and returns the
> constructed struct.
>
> function addScript receives script_t instead of individual members of
> it, and does the appropriate thing.

Why not. Here are two versions:
  *-20.patch is the initial rebased version
  *-21.patch does what you suggested above, some hidden awkwardness     but much less that the previous one.

-- 
Fabien

pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: Re: Incorrect error message in InitializeSessionUserId
Next
From: Fabien COELHO
Date:
Subject: Re: pgbench small bug fix