Re: Poll: are people okay with function/operator table redesign?

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Poll: are people okay with function/operator table redesign?
Дата
Msg-id 19999.1588687623@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Poll: are people okay with function/operator table redesign?  (Dean Rasheed <dean.a.rasheed@gmail.com>)
Список pgsql-hackers
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



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Michael Paquier
Дата:
Сообщение: Re: Postgres Windows build system doesn't work with python installedin Program Files
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Own index methods