pg.ddx.io pgsql-committers@postgresql.org mailing list archive
help / color / mirror / Atom feedpgsql: Rename pgbench min/max to least/greatest, and fix handling of do
3+ messages / 2 participants
[nested] [flat]
* pgsql: Rename pgbench min/max to least/greatest, and fix handling of do
@ 2016-05-05 18:51 Tom Lane <tgl@sss.pgh.pa.us>
0 siblings, 1 reply; 3+ messages in thread
From: Tom Lane @ 2016-05-05 18:51 UTC (permalink / raw)
To: pgsql-committers
Rename pgbench min/max to least/greatest, and fix handling of double args.
These functions behave like the backend's least/greatest functions,
not like min/max, so the originally-chosen names invite confusion.
Per discussion, rename to least/greatest.
I also took it upon myself to make them return double if any input is
double. The previous behavior of silently coercing all inputs to int
surely does not meet the principle of least astonishment.
Copy-edit some of the other new functions' documentation, too.
Branch
------
master
Details
-------
http://git.postgresql.org/pg/commitdiff/7a622b2731db5d0f6db8a3d0af88177f96d1cb2e
Modified Files
--------------
doc/src/sgml/ref/pgbench.sgml | 25 +++++++++--------
src/bin/pgbench/exprparse.y | 8 +++---
src/bin/pgbench/pgbench.c | 64 ++++++++++++++++++++++++++++++++-----------
src/bin/pgbench/pgbench.h | 4 +--
4 files changed, 67 insertions(+), 34 deletions(-)
--
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: pgsql: Rename pgbench min/max to least/greatest, and fix handling of do
@ 2016-05-06 21:27 Fabien COELHO <coelho@cri.ensmp.fr>
parent: Tom Lane <tgl@sss.pgh.pa.us>
0 siblings, 1 reply; 3+ messages in thread
From: Fabien COELHO @ 2016-05-06 21:27 UTC (permalink / raw)
To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: pgsql-committers; pgbdev@cri.ensmp.fr
> Rename pgbench min/max to least/greatest, and fix handling of double
> args.
Ok.
The very minor patch attached re-establishes the alphabetical order when
listing functions names in pgbench documentation.
--
Fabien.
--
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers
Attachments:
pgbench-func-abc-1.patch (text/x-diff, 1.4K) download
diff --git a/doc/src/sgml/ref/pgbench.sgml b/doc/src/sgml/ref/pgbench.sgml
index e6c7c94..ee363ef 100644
--- a/doc/src/sgml/ref/pgbench.sgml
+++ b/doc/src/sgml/ref/pgbench.sgml
@@ -955,13 +955,6 @@ pgbench <optional> <replaceable>options</> </optional> <replaceable>dbname</>
<entry><literal>5432.0</></>
</row>
<row>
- <entry><literal><function>int(<replaceable>x</>)</></></>
- <entry>integer</>
- <entry>cast to int</>
- <entry><literal>int(5.4 + 3.8)</></>
- <entry><literal>9</></>
- </row>
- <row>
<entry><literal><function>greatest(<replaceable>a</> [, <replaceable>...</> ] )</></></>
<entry>double if any <replaceable>a</> is double, else integer</>
<entry>largest value among arguments</>
@@ -969,6 +962,13 @@ pgbench <optional> <replaceable>options</> </optional> <replaceable>dbname</>
<entry><literal>5</></>
</row>
<row>
+ <entry><literal><function>int(<replaceable>x</>)</></></>
+ <entry>integer</>
+ <entry>cast to int</>
+ <entry><literal>int(5.4 + 3.8)</></>
+ <entry><literal>9</></>
+ </row>
+ <row>
<entry><literal><function>least(<replaceable>a</> [, <replaceable>...</> ] )</></></>
<entry>double if any <replaceable>a</> is double, else integer</>
<entry>smallest value among arguments</>
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: pgsql: Rename pgbench min/max to least/greatest, and fix handling of do
@ 2016-05-06 21:49 Tom Lane <tgl@sss.pgh.pa.us>
parent: Fabien COELHO <coelho@cri.ensmp.fr>
0 siblings, 0 replies; 3+ messages in thread
From: Tom Lane @ 2016-05-06 21:49 UTC (permalink / raw)
To: Fabien COELHO <coelho@cri.ensmp.fr>; +Cc: pgsql-committers; pgbdev@cri.ensmp.fr
> The very minor patch attached re-establishes the alphabetical order when
> listing functions names in pgbench documentation.
Pushed, thanks.
regards, tom lane
--
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers
^ permalink raw reply [nested|flat] 3+ messages in thread
end of thread, other threads:[~2016-05-06 21:49 UTC | newest]
Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2016-05-05 18:51 pgsql: Rename pgbench min/max to least/greatest, and fix handling of do Tom Lane <tgl@sss.pgh.pa.us>
2016-05-06 21:27 ` Fabien COELHO <coelho@cri.ensmp.fr>
2016-05-06 21:49 ` Tom Lane <tgl@sss.pgh.pa.us>
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