Re: factorial function/phase out postfix operators? - Mailing list pgsql-hackers

From Tom Lane
Subject Re: factorial function/phase out postfix operators?
Date
Msg-id 27490.1589896296@sss.pgh.pa.us
Whole thread Raw
In response to Re: factorial function/phase out postfix operators?  (Robert Haas <robertmhaas@gmail.com>)
Responses Re: factorial function/phase out postfix operators?
List pgsql-hackers
Robert Haas <robertmhaas@gmail.com> writes:
> I think it's generally a good idea, though perhaps we should consider
> continuing to allow '!' as a postfix operator and just removing
> support for any other.

Uh ... what exactly would be the point of that?  The real reason to do
this at all is not that we have it in for '!', but that we want to
drop the possibility of postfix operators from the grammar altogether,
which will remove a boatload of ambiguity.

> I won't lose a lot of sleep if we decide to rip out '!' as well, but I
> don't think that continuing to support it would cost us much.

AFAICS, it would cost us the entire point of this change.

In my non-caffeinated state, I don't recall exactly which things are
blocked by the existence of postfix ops; but I think for instance it might
become possible to remove the restriction of requiring AS before column
aliases that happen to be unreserved keywords.

If we lobotomize CREATE OPERATOR but don't remove built-in postfix
ops, then none of those improvements will be available.  That seems
like the worst possible choice.

I would also argue that having a feature that is available to
built-in operators but not user-defined ones is pretty antithetical
to Postgres philosophy.

            regards, tom lane



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Expand the use of check_canonical_path() for more GUCs
Next
From: Atsushi Torikoshi
Date:
Subject: Re: Is it useful to record whether plans are generic or custom?