pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
pgsql: Add pow(), aka power(), function to pgbench.
5+ messages / 5 participants
[nested] [flat]

* pgsql: Add pow(), aka power(), function to pgbench.
@ 2017-12-27 18:47 Robert Haas <rhaas@postgresql.org>
  2017-12-29 09:58 ` Re: pgsql: Add pow(), aka power(), function to pgbench. Thomas Munro <thomas.munro@enterprisedb.com>
  0 siblings, 1 reply; 5+ messages in thread

From: Robert Haas @ 2017-12-27 18:47 UTC (permalink / raw)
  To: pgsql-committers

Add pow(), aka power(), function to pgbench.

Raúl Marín Rodríguez, reviewed by Fabien Coelho and Michael Paquier,
with a minor fix by me.

Discussion: http://postgr.es/m/CAM6_UM4XiA14y9HnDqu9kAAOtwMhHZxW--q_ZACZW9Hsrsf-tg@mail.gmail.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/7a727c180aa3c3baba12957d4cbec7b022ba4be5

Modified Files
--------------
doc/src/sgml/ref/pgbench.sgml                |  7 +++++++
src/bin/pgbench/exprparse.y                  |  6 ++++++
src/bin/pgbench/pgbench.c                    | 18 ++++++++++++++++++
src/bin/pgbench/pgbench.h                    |  3 ++-
src/bin/pgbench/t/001_pgbench_with_server.pl | 22 +++++++++++++++++++++-
5 files changed, 54 insertions(+), 2 deletions(-)



^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: pgsql: Add pow(), aka power(), function to pgbench.
  2017-12-27 18:47 pgsql: Add pow(), aka power(), function to pgbench. Robert Haas <rhaas@postgresql.org>
@ 2017-12-29 09:58 ` Thomas Munro <thomas.munro@enterprisedb.com>
  2017-12-29 11:57   ` Re: pgsql: Add pow(), aka power(), function to pgbench. Fabien COELHO <coelho@cri.ensmp.fr>
  0 siblings, 1 reply; 5+ messages in thread

From: Thomas Munro @ 2017-12-29 09:58 UTC (permalink / raw)
  To: Robert Haas <rhaas@postgresql.org>; +Cc: pgsql-committers; rmrodriguez@carto.com

On Thu, Dec 28, 2017 at 7:47 AM, Robert Haas <rhaas@postgresql.org> wrote:
> Add pow(), aka power(), function to pgbench.
>
> Raúl Marín Rodríguez, reviewed by Fabien Coelho and Michael Paquier,
> with a minor fix by me.
>
> Discussion: http://postgr.es/m/CAM6_UM4XiA14y9HnDqu9kAAOtwMhHZxW--q_ZACZW9Hsrsf-tg@mail.gmail.com
>
> Branch
> ------
> master
>
> Details
> -------
> https://git.postgresql.org/pg/commitdiff/7a727c180aa3c3baba12957d4cbec7b022ba4be5
>
> Modified Files
> --------------
> doc/src/sgml/ref/pgbench.sgml                |  7 +++++++
> src/bin/pgbench/exprparse.y                  |  6 ++++++
> src/bin/pgbench/pgbench.c                    | 18 ++++++++++++++++++
> src/bin/pgbench/pgbench.h                    |  3 ++-
> src/bin/pgbench/t/001_pgbench_with_server.pl | 22 +++++++++++++++++++++-
> 5 files changed, 54 insertions(+), 2 deletions(-)

This seems to have caused a couple of BF failures on Windows (sorry
for my role in hiding those, I've just been reviewing all failures to
atone):

https://buildfarm.postgresql.org/cgi-bin/show_log.pl?nm=jacana&dt=2017-12-28%2013%3A00%3A27
https://buildfarm.postgresql.org/cgi-bin/show_log.pl?nm=bowerbird&dt=2017-12-28%2011%3A30%3A23

Excerpts:

# debug(script=0,command=31): double 8.50705917302346e+037
#     doesn't match '(?^:command=31.: double 8.50705917302346e\+37\b)'

# debug(script=0,command=32): double 1e+030
#     doesn't match '(?^:command=32.: double 1e\+30\b)'

The difference seems to be a leading zero before the exponent, so
perhaps the patterns need "0*" in there?

-- 
Thomas Munro
http://www.enterprisedb.com




^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: pgsql: Add pow(), aka power(), function to pgbench.
  2017-12-27 18:47 pgsql: Add pow(), aka power(), function to pgbench. Robert Haas <rhaas@postgresql.org>
  2017-12-29 09:58 ` Re: pgsql: Add pow(), aka power(), function to pgbench. Thomas Munro <thomas.munro@enterprisedb.com>
@ 2017-12-29 11:57   ` Fabien COELHO <coelho@cri.ensmp.fr>
  2017-12-29 13:04     ` Re: pgsql: Add pow(), aka power(), function to pgbench. Raúl Marín Rodríguez <rmrodriguez@carto.com>
  0 siblings, 1 reply; 5+ messages in thread

From: Fabien COELHO @ 2017-12-29 11:57 UTC (permalink / raw)
  To: Thomas Munro <thomas.munro@enterprisedb.com>; +Cc: Robert Haas <rhaas@postgresql.org>; pgsql-committers; rmrodriguez@carto.com


> # debug(script=0,command=31): double 8.50705917302346e+037
> #     doesn't match '(?^:command=31.: double 8.50705917302346e\+37\b)'
>
> # debug(script=0,command=32): double 1e+030
> #     doesn't match '(?^:command=32.: double 1e\+30\b)'
>
> The difference seems to be a leading zero before the exponent, so
> perhaps the patterns need "0*" in there?

Probably "0?". Although an int with leading zeros is usually an octal 
number, so window's rational fails me.

-- 
Fabien.




^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: pgsql: Add pow(), aka power(), function to pgbench.
  2017-12-27 18:47 pgsql: Add pow(), aka power(), function to pgbench. Robert Haas <rhaas@postgresql.org>
  2017-12-29 09:58 ` Re: pgsql: Add pow(), aka power(), function to pgbench. Thomas Munro <thomas.munro@enterprisedb.com>
  2017-12-29 11:57   ` Re: pgsql: Add pow(), aka power(), function to pgbench. Fabien COELHO <coelho@cri.ensmp.fr>
@ 2017-12-29 13:04     ` Raúl Marín Rodríguez <rmrodriguez@carto.com>
  2017-12-29 13:51       ` Re: pgsql: Add pow(), aka power(), function to pgbench. Andrew Dunstan <andrew.dunstan@2ndquadrant.com>
  0 siblings, 1 reply; 5+ messages in thread

From: Raúl Marín Rodríguez @ 2017-12-29 13:04 UTC (permalink / raw)
  To: Fabien COELHO <coelho@cri.ensmp.fr>; +Cc: Thomas Munro <thomas.munro@enterprisedb.com>; Robert Haas <rhaas@postgresql.org>; pgsql-committers

>
> Probably "0?". Although an int with leading zeros is usually an octal
> number, so window's rational fails me.


You are right. From the C99 standard:

> The exponent always contains at least two digits, and only as many more
> digits as necessary to represent the exponent. If the value is zero, the
> exponent is zero.


 Both solutions seem fine to me. Also, as these couple of tests were added
to check for int overflow and we no longer do any int operations, removing
them wouldn't be a big loss.
-- 

*Raúl Marín Rodríguez *carto.com

^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: pgsql: Add pow(), aka power(), function to pgbench.
  2017-12-27 18:47 pgsql: Add pow(), aka power(), function to pgbench. Robert Haas <rhaas@postgresql.org>
  2017-12-29 09:58 ` Re: pgsql: Add pow(), aka power(), function to pgbench. Thomas Munro <thomas.munro@enterprisedb.com>
  2017-12-29 11:57   ` Re: pgsql: Add pow(), aka power(), function to pgbench. Fabien COELHO <coelho@cri.ensmp.fr>
  2017-12-29 13:04     ` Re: pgsql: Add pow(), aka power(), function to pgbench. Raúl Marín Rodríguez <rmrodriguez@carto.com>
@ 2017-12-29 13:51       ` Andrew Dunstan <andrew.dunstan@2ndquadrant.com>
  0 siblings, 0 replies; 5+ messages in thread

From: Andrew Dunstan @ 2017-12-29 13:51 UTC (permalink / raw)
  To: Raúl Marín Rodríguez <rmrodriguez@carto.com>; Fabien COELHO <coelho@cri.ensmp.fr>; +Cc: Thomas Munro <thomas.munro@enterprisedb.com>; Robert Haas <rhaas@postgresql.org>; pgsql-committers



On 12/29/2017 08:04 AM, Raúl Marín Rodríguez wrote:
>
>     Probably "0?". Although an int with leading zeros is usually an
>     octal number, so window's rational fails me.
>
>
> You are right. From the C99 standard:
>
>     The exponent always contains at least two digits, and only as many
>     more digits as necessary to represent the exponent. If the value
>     is zero, the exponent is zero.
>
>
>  Both solutions seem fine to me. Also, as these couple of tests were
> added to check for int overflow and we no longer do any int
> operations, removing them wouldn't be a big loss. 
> -- 
> *Raúl Marín Rodríguez 
> *carto.com <http://carto.com/;
>


0? seems right. I have committed that.

cheers

andrew

-- 
Andrew Dunstan                https://www.2ndQuadrant.com
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services





^ permalink  raw  reply  [nested|flat] 5+ messages in thread


end of thread, other threads:[~2017-12-29 13:51 UTC | newest]

Thread overview: 5+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2017-12-27 18:47 pgsql: Add pow(), aka power(), function to pgbench. Robert Haas <rhaas@postgresql.org>
2017-12-29 09:58 ` Thomas Munro <thomas.munro@enterprisedb.com>
2017-12-29 11:57   ` Fabien COELHO <coelho@cri.ensmp.fr>
2017-12-29 13:04     ` Raúl Marín Rodríguez <rmrodriguez@carto.com>
2017-12-29 13:51       ` Andrew Dunstan <andrew.dunstan@2ndquadrant.com>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox