Re: [HACKERS] pgbench more operators & functions

Поиск
Список
Период
Сортировка
От Pavel Stehule
Тема Re: [HACKERS] pgbench more operators & functions
Дата
Msg-id CAFj8pRDivVf3TGUGE23DTMgUkDdDAzrHuEydPQyTMPBYaKzByA@mail.gmail.com
обсуждение исходный текст
Ответ на Re: [HACKERS] pgbench more operators & functions  (Fabien COELHO <coelho@cri.ensmp.fr>)
Ответы Re: [HACKERS] pgbench more operators & functions  (Fabien COELHO <coelho@cri.ensmp.fr>)
Список pgsql-hackers
Hi

2017-09-09 11:02 GMT+02:00 Fabien COELHO <coelho@cri.ensmp.fr>:

Hello Pavel,

Here is a v13. No code changes, but TAP tests added to maintain pgbench coverage to green.


Summary of patch contents:

This patch extends pgbench expressions syntax while keeping compatibility with SQL expressions.

It adds support for NULL and BOOLEAN, as well as assorted logical, comparison and test operators (AND, <>, <=, IS NULL...).

A CASE construct is provided which takes advantage of the added BOOLEAN.

Integer and double functions and operators are also extended: bitwise operators (<< & ...), exp/ln, mod() as synonymous to % (matching pg).

Added TAP tests maintain pgbench source coverage to green (if you ignore lexer & parser generated files...).


Future plans include extending and synchronizing psql & pgbench variable and expression syntaxes:
 - move expression parsing and evaluation in fe_utils,
   which would allow to
 - extend psql with some \let i <expression> cliend-side syntax
   (ISTM that extending the \set syntax cannot be upward compatible)
   and probably handle \let as a synonymous to \set in pgbench.
 - allow \if <expression> in psql instead of just \if <boolean>
 - add \if ... support to pgbench
 - maybe add TEXT type support to the expression engine, if useful
 - maybe add :'var" and :"var" support to pgbench, if useful

There are already patches in the queue for:
 - testing whether a variable is defined in psql
   feature could eventually be added to pgbench as well
 - adding \gset (& \cset) to pgbench to get output of possibly
   combined queries into variables, which can be used for making
   decisions later in the script.

--
Fabien.

1. there are no any problem with compilation, patching
2. all tests passed 
3. doc is ok
 
I'll mark this patch as ready for commiter

Regards

Pavel

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

Предыдущее
От: Jaime Casanova
Дата:
Сообщение: Re: [HACKERS] generated columns
Следующее
От: Amit Kapila
Дата:
Сообщение: Re: [HACKERS] Setting pd_lower in GIN metapage