Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jVyE7-0007kx-8v for pgsql-hackers@arkaria.postgresql.org; Tue, 05 May 2020 14:07:15 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1jVyE6-0005o9-3X for pgsql-hackers@arkaria.postgresql.org; Tue, 05 May 2020 14:07:14 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jVyE5-0005o0-TE for pgsql-hackers@lists.postgresql.org; Tue, 05 May 2020 14:07:13 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jVyE3-0005Lx-B8 for pgsql-hackers@lists.postgresql.org; Tue, 05 May 2020 14:07:13 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id 045E73r5020000; Tue, 5 May 2020 10:07:03 -0400 From: Tom Lane To: Dean Rasheed cc: "Jonathan S. Katz" , Peter Eisentraut , Bruce Momjian , Alvaro Herrera , Robert Haas , Steven Pousty , Pavel Stehule , Isaac Morland , Pierre Giraud , PostgreSQL Developers Subject: Re: Poll: are people okay with function/operator table redesign? In-reply-to: References: <20200423174343.GA16996@alvherre.pgsql> <19233.1587665407@sss.pgh.pa.us> <5561.1587922854@sss.pgh.pa.us> <13e5e408-bc59-e8ca-44f3-28a981b4fc7d@postgresql.org> <11211.1587951842@sss.pgh.pa.us> <58de9544-be5b-f325-b5cc-cce4e2dda7d9@postgresql.org> <5651.1587991781@sss.pgh.pa.us> <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> <18310.1588214299@sss.pgh.pa.us> <20585.1588217180@sss.pgh.pa.us> <751.1588627321@sss.pgh.pa.us> Comments: In-reply-to Dean Rasheed message dated "Tue, 05 May 2020 10:33:55 +0100" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <19998.1588687623.1@sss.pgh.pa.us> Date: Tue, 05 May 2020 10:07:03 -0400 Message-ID: <19999.1588687623@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Dean Rasheed writes: > On Mon, 4 May 2020 at 22:22, Tom Lane 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