Re: [HACKERS] pgbench - allow to store select results intovariables

Поиск
Список
Период
Сортировка
От Fabien COELHO
Тема Re: [HACKERS] pgbench - allow to store select results intovariables
Дата
Msg-id alpine.DEB.2.20.1701070938300.10378@lancre
обсуждение исходный текст
Ответ на Re: [HACKERS] pgbench - allow to store select results into variables  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: [HACKERS] pgbench - allow to store select results intovariables  (Fabien COELHO <coelho@cri.ensmp.fr>)
Re: [HACKERS] pgbench - allow to store select results into variables  (Michael Paquier <michael.paquier@gmail.com>)
Список pgsql-hackers
Hello Tom,

> Please look at changing \into to be a SQL-command-ending backslash
> command as we previously discussed.

Done.

There are two variants: \gset & \gcset for compound (end SQL query, set 
variables, but do not end command, so that several settings are allowed in 
a compound command, a key feature for performance testing).

Personnally, I find the end-of-query semicolon-replacing syntax ugly. 
However I'm more interested in feature than in elegance on this one, so 
I'll put up with it.


> I think you will find that the implementation is a great deal simpler 
> that way and doesn't require weird hackery on the shared lexer.

I have removed the "hackery", only counting embedded semicolons remains to 
keep track of compound queries.

Note that the (somehow buggy and indeed not too clean) hackery was not 
related to the into syntax, but to detecting empty queries which are 
silently skipped by the server.

> If you won't do that, [...]

I think that I have done what you required.

I have documented the fact that now the feature does not work if compound 
commands contain empty queries, which is a very minor drawback for a 
pgbench script anyway.

Attached are the patch, a test script for the feature, and various test 
scripts to trigger error cases.

-- 
Fabien.
-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

Вложения

В списке pgsql-hackers по дате отправления:

Предыдущее
От: Andrew Borodin
Дата:
Сообщение: Re: [HACKERS] pg_background contrib module proposal
Следующее
От: Magnus Hagander
Дата:
Сообщение: Re: [HACKERS] Support for pg_receivexlog --format=plain|tar