Remove support for postfix (right-unary) operators.

Tom Lane <tgl@sss.pgh.pa.us>

Commit: 1ed6b895634ce0dc5fd4bd040e87252b32182cba
Author: Tom Lane <tgl@sss.pgh.pa.us>
Date: 2020-09-17T23:38:05Z
Releases: 14.0
Remove support for postfix (right-unary) operators.

This feature has been a thorn in our sides for a long time, causing
many grammatical ambiguity problems.  It doesn't seem worth the
pain to continue to support it, so remove it.

There are some follow-on improvements we can make in the grammar,
but this commit only removes the bare minimum number of productions,
plus assorted backend support code.

Note that pg_dump and psql continue to have full support, since
they may be used against older servers.  However, pg_dump warns
about postfix operators.  There is also a check in pg_upgrade.

Documentation-wise, I (tgl) largely removed the "left unary"
terminology in favor of saying "prefix operator", which is
a more standard and IMO less confusing term.

I included a catversion bump, although no initial catalog data
changes here, to mark the boundary at which oprkind = 'r'
stopped being valid in pg_operator.

Mark Dilger, based on work by myself and Robert Haas;
review by John Naylor

Discussion: https://postgr.es/m/38ca86db-42ab-9b48-2902-337a0d6b8311@2ndquadrant.com

Files

PathChange+/−
contrib/postgres_fdw/deparse.c modified +6 −13
doc/src/sgml/catalogs.sgml modified +4 −4
doc/src/sgml/ref/alter_extension.sgml modified +1 −1
doc/src/sgml/ref/alter_operator.sgml modified +4 −5
doc/src/sgml/ref/alter_opfamily.sgml modified +1 −1
doc/src/sgml/ref/comment.sgml modified +1 −1
doc/src/sgml/ref/create_opclass.sgml modified +1 −1
doc/src/sgml/ref/create_operator.sgml modified +5 −17
doc/src/sgml/ref/drop_operator.sgml modified +4 −12
doc/src/sgml/syntax.sgml modified +2 −3
doc/src/sgml/typeconv.sgml modified +3 −3
doc/src/sgml/xoper.sgml modified +6 −6
src/backend/catalog/namespace.c modified +3 −4
src/backend/catalog/pg_operator.c modified +2 −2
src/backend/commands/operatorcmds.c modified +13 −1
src/backend/nodes/print.c modified +0 −1
src/backend/parser/gram.y modified +2 −11
src/backend/parser/parse_expr.c modified +10 −28
src/backend/parser/parse_oper.c modified +22 −106
src/backend/utils/adt/ruleutils.c modified +7 −32
src/bin/pg_dump/pg_dump.c modified +7 −1
src/bin/pg_upgrade/check.c modified +106 −0
src/bin/psql/describe.c modified +4 −0
src/include/catalog/catversion.h modified +1 −1
src/include/catalog/pg_operator.h modified +3 −3
src/include/parser/parse_oper.h modified +0 −2
src/test/regress/expected/create_operator.out modified +32 −18
src/test/regress/expected/opr_sanity.out modified +2 −15
src/test/regress/sql/create_operator.sql modified +20 −16
src/test/regress/sql/opr_sanity.sql modified +2 −12
src/tutorial/complex.source modified +1 −1
src/tutorial/syscat.source modified +5 −19

Documentation touched

Discussion