Re: [HACKERS] pow support for pgbench

Поиск
Список
Период
Сортировка
Искать
От
Fabien COELHO
Тема
Re: [HACKERS] pow support for pgbench
Дата
Msg-id
alpine.DEB.2.20.1712012311470.5511@lancre
Ответ на
Список
Дерево обсуждения
[HACKERS] pow support for pgbench Raúl Marín Rodríguez <rmrodriguez@carto.com>
Re: [HACKERS] pow support for pgbench Michael Paquier <michael.paquier@gmail.com>
Re: [HACKERS] pow support for pgbench Alvaro Herrera <alvherre@alvh.no-ip.org>
Re: [HACKERS] pow support for pgbench Michael Paquier <michael.paquier@gmail.com>
Re: [HACKERS] pow support for pgbench Raúl Marín Rodríguez <rmrodriguez@carto.com>
Re: [HACKERS] pow support for pgbench Michael Paquier <michael.paquier@gmail.com>
Re: [HACKERS] pow support for pgbench Alvaro Herrera <alvherre@alvh.no-ip.org>
Re: [HACKERS] pow support for pgbench Raúl Marín Rodríguez <rmrodriguez@carto.com>
Re: [HACKERS] pow support for pgbench Fabien COELHO <coelho@cri.ensmp.fr>
Re: [HACKERS] pow support for pgbench Raúl Marín Rodríguez <rmrodriguez@carto.com>
Re: [HACKERS] pow support for pgbench Fabien COELHO <coelho@cri.ensmp.fr>
Re: [HACKERS] pow support for pgbench Raúl Marín Rodríguez <rmrodriguez@carto.com>
Re: [HACKERS] pow support for pgbench Fabien COELHO <coelho@cri.ensmp.fr>
Re: [HACKERS] pow support for pgbench Raúl Marín Rodríguez <rmrodriguez@carto.com>
Re: pow support for pgbench Chapman Flack <chap@anastigmatix.net>
Re: [HACKERS] pow support for pgbench Fabien COELHO <coelho@cri.ensmp.fr>
Re: [HACKERS] pow support for pgbench Fabien COELHO <coelho@cri.ensmp.fr>

Hello Robert,

> The fact that the return type is not consistently of one type bothers
> me.  I'm not sure pgbench's expression language is a good place to
> runtime polymorphism -- SQL doesn't work that way.

Sure.

Pg has a NUMERIC adaptative precision version, which is cheating, because 
it can return kind of an "int" or a "float", depending on whether there 
are digits after the decimal point or not.

Pgbench does not have support for NUMERIC, just INT & DOUBLE, so the 
current version is an approximation of that.

Now it is always possible to just do DOUBLE version, but this won't match 
SQL behavior either.

> + /*
> +  * pow() for integer values with exp >= 0. Matches SQL pow() behaviour
> +  */
>
> What's the name of the backend function whose behavior this matches?

POW(numeric,numeric) -> numeric, which matches "numeric_power".

-- 
Fabien.

В списке pgsql-hackers по дате отправления
От: Andres Freund
Дата:
От: Michael Paquier
Дата:
FAQ