Re: [HACKERS] pow support for pgbench

Поиск
Список
Период
Сортировка
От Fabien COELHO
Тема Re: [HACKERS] pow support for pgbench
Дата
Msg-id alpine.DEB.2.20.1711061406320.5606@lancre
обсуждение исходный текст
Ответ на 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>)
Список pgsql-hackers
Hello Raúl,

> I've fixed the documentation and added an ipow function that handles both
> positive and negative ints, having 0^0 == 1 and 0^(negative) == PG_INT64_MAX
> since that's what my glibc math.h pow() is returning.

From the comment:
 * For exp < 0 return 0 except when the base is 1 or -1

I think that it should do what POW does in psql, i.e.:
 fabien=# SELECT POW(2, -2); # 0.25

that is if exp < 0 the double version should be used, it should
not return 0.

Basically the idea is that the pgbench client-side version should behave 
the same as the SQL version.

-- 
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 по дате отправления:

Предыдущее
От: Kyotaro HORIGUCHI
Дата:
Сообщение: Re: [HACKERS] proposal - Default namespaces for XPath expressions(PostgreSQL 11)
Следующее
От: Konstantin Knizhnik
Дата:
Сообщение: Re: [HACKERS] Secondary index access optimizations