Re: extend pgbench expressions with functions

Поиск
Список
Период
Сортировка
От Fabien COELHO
Тема Re: extend pgbench expressions with functions
Дата
Msg-id alpine.DEB.2.10.1507252202530.25082@sto
обсуждение исходный текст
Ответ на Re: extend pgbench expressions with functions  (Heikki Linnakangas <hlinnaka@iki.fi>)
Ответы Re: extend pgbench expressions with functions  (Fabien COELHO <coelho@cri.ensmp.fr>)
Список pgsql-hackers
Hello Heikki,

> As an initial list of functions, I'd suggest:
>
> abs(x)
> min(x, y, ...)
> max(x, y, ...)
> random_uniform(min, max)
> random_gaussian(min, max, threshold)
> random_exponential(min, max, threshold)
>
> Would that be enough to specify e.g. the
>
> As soon as we add more functions, the way they are documented needs to be 
> reworked too; we'll need to add a table in the manual to list them.

Here is a v8 with "abs", "min", "max", "random", "gaussian" et
"exponential".

There is no expression typing, but expressions are evaluated and cast to 
the expected type depending on what is needed (variables expect an int 
value, function arguments are usually int but for threshold...).

There is an evalDouble function to evaluate double arguments for 
gaussian & exponential thresholds.

There is a special "int" function which evaluates its argument as a double 
and cast the result to an int, for testing purpose.

Variables are only int values, and functions only return ints.

There is no real doc, WIP...

Also included are a set of sql stuff I used for minimal tests.

-- 
Fabien.

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Anyone working on the TOAST items on the TODO list?
Следующее
От: Bill Moran
Дата:
Сообщение: Re: Anyone working on the TOAST items on the TODO list?