New pgbench functions are misnamed

Started by Tom Laneover 9 years ago4 messages
#1Tom Lane
tgl@sss.pgh.pa.us

I noticed that commit 7e137f846 added functions named max() and min()
to pgbench's expression syntax. Unfortunately, these functions have
zilch to do with what max() and min() do in SQL. They're actually more
like the greatest() and least() server-side functions.

While I can't imagine that we'd ever want to implement true aggregates
in pgbench expressions, it still seems like this is a recipe for
confusion. Shouldn't we rename these to greatest() and least()?

regards, tom lane

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

#2Robert Haas
robertmhaas@gmail.com
In reply to: Tom Lane (#1)
Re: New pgbench functions are misnamed

On Wed, May 4, 2016 at 5:41 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:

I noticed that commit 7e137f846 added functions named max() and min()
to pgbench's expression syntax. Unfortunately, these functions have
zilch to do with what max() and min() do in SQL. They're actually more
like the greatest() and least() server-side functions.

While I can't imagine that we'd ever want to implement true aggregates
in pgbench expressions, it still seems like this is a recipe for
confusion. Shouldn't we rename these to greatest() and least()?

Yeah, that's probably a good idea.

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

#3Fabien COELHO
coelho@cri.ensmp.fr
In reply to: Tom Lane (#1)
Re: New pgbench functions are misnamed

I noticed that commit 7e137f846 added functions named max() and min()
to pgbench's expression syntax. Unfortunately, these functions have
zilch to do with what max() and min() do in SQL. They're actually more
like the greatest() and least() server-side functions.

Yep.

While I can't imagine that we'd ever want to implement true aggregates
in pgbench expressions, it still seems like this is a recipe for
confusion. Shouldn't we rename these to greatest() and least()?

My 0,02ᅵ: I like the simplicity of min/max names and I think that anyone
would manage to deal with this level of confusion in a pgbench script, so
I would not bother.

But if it is to be changed, best do it now!

--
Fabien.
--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

#4Tom Lane
tgl@sss.pgh.pa.us
In reply to: Robert Haas (#2)
Re: New pgbench functions are misnamed

Robert Haas <robertmhaas@gmail.com> writes:

On Wed, May 4, 2016 at 5:41 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:

I noticed that commit 7e137f846 added functions named max() and min()
to pgbench's expression syntax. Unfortunately, these functions have
zilch to do with what max() and min() do in SQL. They're actually more
like the greatest() and least() server-side functions.

While I can't imagine that we'd ever want to implement true aggregates
in pgbench expressions, it still seems like this is a recipe for
confusion. Shouldn't we rename these to greatest() and least()?

Yeah, that's probably a good idea.

The vote seems to be 2 to 1 in favor, so I'll go do this.

regards, tom lane

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers