Re: [HACKERS] pgbench - allow to store select results into variables - Mailing list pgsql-hackers

From Rafia Sabih
Subject Re: [HACKERS] pgbench - allow to store select results into variables
Date
Msg-id CAOGQiiNRbx8mnL-Aums3PMtxhtcKn0DuPmnvJNH1eLVQQ4Qy6Q@mail.gmail.com
Whole thread Raw
In response to Re: [HACKERS] pgbench - allow to store select results intovariables  (Fabien COELHO <coelho@cri.ensmp.fr>)
Responses Re: pgbench - allow to store select results intovariables  (Fabien COELHO <coelho@cri.ensmp.fr>)
List pgsql-hackers
On Thu, Mar 16, 2017 at 12:45 AM, Fabien COELHO <coelho@cri.ensmp.fr> wrote:
>
> Hello Rafia,
>
>> I was reviewing v7 of this patch, to start with I found following white
>> space errors when applying with git apply,
>> /home/edb/Desktop/patches/others/pgbench-into-7.patch:66: trailing
>> whitespace.
>
>
> Yep.
>
> I do not know why "git apply" sometimes complains. All is fine for me both
> with "git apply" and "patch".
>
> Last time it was because my mailer uses text/x-diff for the mime type, as
> define by the system in "/etc/mime.types", which some mailer then interpret
> as a license to change eol-style when saving, resulting in this kind of
> behavior. Could you tell your mailer just to save the file as is?
>
>> Apart from that, on executing SELECT 1 AS a \gset \set i debug(:a) SELECT
>> 2
>> AS a \gcset SELECT 3; given in your provided script gset-1.sql. it is
>> giving error Invalid command \gcset.
>
>
> Are you sure that you are using the compiled pgbench, not a previously
> installed one?
>
>   bin/pgbench> pgbench -t 1 -f SQL/gset-1.sql
>     SQL/gset-1.sql:1: invalid command in command "gset"
>     \gset
>
>   bin/pgbench> ./pgbench -t 1 -f SQL/gset-1.sql
>     starting vacuum...end.
>     debug(script=0,command=2): int 1
>     debug(script=0,command=4): int 2
>     ...
>
>> Not sure what is the intention of this script anyway?
>
>
> The intention is to test that gset & gcset work as expected in various
> settings, especially with combined queries (\;) the right result must be
> extracted in the sequence.
>
>> Also, instead of so many different files for error why don't you combine
>> it into one.
>
>
> Because a pgbench scripts stops on the first error, and I wanted to test
> what happens with several kind of errors.
>
if (my_command->argc > 2)
+ syntax_error(source, lineno, my_command->line, my_command->argv[0],
+ "at most on argument expected", NULL, -1);

I suppose you mean 'one' argument here.
Apart from that indentation is not correct as per pgindent, please check.

-- 
Regards,
Rafia Sabih
EnterpriseDB: http://www.enterprisedb.com/



pgsql-hackers by date:

Previous
From: Amit Khandekar
Date:
Subject: Re: [HACKERS] Parallel Append implementation
Next
From: Jeevan Chalke
Date:
Subject: Re: [HACKERS] Partition-wise aggregation/grouping