pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Dean Rasheed <dean.a.rasheed@gmail.com>
Cc: Jonathan S. Katz <jkatz@postgresql.org>
Cc: Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
Cc: Bruce Momjian <bruce@momjian.us>
Cc: Alvaro Herrera <alvherre@2ndquadrant.com>
Cc: Robert Haas <robertmhaas@gmail.com>
Cc: Steven Pousty <steve.pousty@gmail.com>
Cc: Pavel Stehule <pavel.stehule@gmail.com>
Cc: Isaac Morland <isaac.morland@gmail.com>
Cc: Pierre Giraud <pierre.giraud@dalibo.com>
Cc: PostgreSQL Developers <pgsql-hackers@lists.postgresql.org>
Subject: Re: Poll: are people okay with function/operator table redesign?
Date: Tue, 05 May 2020 10:07:03 -0400
Message-ID: <19999.1588687623@sss.pgh.pa.us> (raw)
In-Reply-To: <CAEZATCWd+KVKvZzt-7sQy6gDXNQe64qEcDKMjNadSEhaLpqwow@mail.gmail.com>
References: <20200423174343.GA16996@alvherre.pgsql>
	<19233.1587665407@sss.pgh.pa.us>
	<5561.1587922854@sss.pgh.pa.us>
	<13e5e408-bc59-e8ca-44f3-28a981b4fc7d@postgresql.org>
	<a47ea348-b9a0-02b7-5bcb-7a32143dd16f@postgresql.org>
	<11211.1587951842@sss.pgh.pa.us>
	<58de9544-be5b-f325-b5cc-cce4e2dda7d9@postgresql.org>
	<5651.1587991781@sss.pgh.pa.us>
	<b998a672-2525-1cba-ac64-b292f495919e@postgresql.org>
	<30469.1588087170@sss.pgh.pa.us>
	<8682.1588202983@sss.pgh.pa.us>
	<4894cde4-148d-f0cc-d6d8-182a46f13e1b@postgresql.org>
	<06f6b32d-a4cc-3723-5bc1-00fa674df961@postgresql.org>
	<11106.1588205727@sss.pgh.pa.us>
	<1c5ca197-f7f2-0300-46ce-4652c7f81d48@postgresql.org>
	<ab7803b4-f985-cf3d-267f-38b7311ca917@postgresql.org>
	<18310.1588214299@sss.pgh.pa.us>
	<c5f34a44-ccb9-c59e-ee5a-c8d97980df15@postgresql.org>
	<20585.1588217180@sss.pgh.pa.us>
	<b1f89d14-cd7f-e43d-964e-9fb04e209b72@postgresql.org>
	<751.1588627321@sss.pgh.pa.us>
	<CAEZATCWd+KVKvZzt-7sQy6gDXNQe64qEcDKMjNadSEhaLpqwow@mail.gmail.com>

Dean Rasheed <dean.a.rasheed@gmail.com> writes:
> On Mon, 4 May 2020 at 22:22, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>> Now I could have done this example by spelling out all six varieties of
>> stddev() separately, and maybe I should've, but it seemed overly bulky
>> that way.

> FWIW, I prefer having each variety spelled out separately. For
> example, I really like the new way that aggregates like sum() and
> avg() are displayed. To me, having all the types listed like that is
> much more readable than having to read and interpret a piece of free
> text.

> Similarly, for other functions like gcd(), lcm() and mod(). I think it
> would be better to get rid of numeric_type, and just list all the
> variants of each function.

I had had the same idea to start with, but it didn't survive first contact
with table 9.4 (Mathematical Operators).  It's not really reasonable to
spell out all the variants of + ... especially not if you want to be
precise, because then you'd have to list the cross-type variants too.
If I counted correctly, there are fourteen variants of binary + that
would have to be listed in that table, never mind the other common
operators.

max() and min() have a similar sort of problem --- the list of variants
is just dauntingly long, and it's not that interesting either.
I wrote out sum() and avg() the way I did because they have a somewhat
irregular mapping from input to output types, so it seemed better to
just list the alternatives explicitly.

I don't object too much to spelling out the variants of stddev()
and variance(), if there's a consensus for that.  But getting rid
of "numeric_type" entirely seems impractical.

			regards, tom lane





view thread (113+ messages)  latest in thread

Message-ID: <19999.1588687623@sss.pgh.pa.us>
Permalink:  ../19999.1588687623@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/19999.1588687623@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-hackers@postgresql.org
  Cc: tgl@sss.pgh.pa.us, dean.a.rasheed@gmail.com, jkatz@postgresql.org, peter.eisentraut@2ndquadrant.com, bruce@momjian.us, alvherre@2ndquadrant.com, robertmhaas@gmail.com, steve.pousty@gmail.com, pavel.stehule@gmail.com, isaac.morland@gmail.com, pierre.giraud@dalibo.com, pgsql-hackers@lists.postgresql.org
  Subject: Re: Poll: are people okay with function/operator table redesign?
  In-Reply-To: <19999.1588687623@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

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