Remove support for postfix (right-unary) operators.
authorTom Lane <tgl@sss.pgh.pa.us>
Thu, 17 Sep 2020 23:38:05 +0000 (19:38 -0400)
committerTom Lane <tgl@sss.pgh.pa.us>
Thu, 17 Sep 2020 23:38:05 +0000 (19:38 -0400)
commit1ed6b895634ce0dc5fd4bd040e87252b32182cba
treed0f22d227e7df8ca5139baf4eba578de052f6a82
parent76f412ab310554acb970a0b73c8d1f37f35548c6
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
32 files changed:
contrib/postgres_fdw/deparse.c
doc/src/sgml/catalogs.sgml
doc/src/sgml/ref/alter_extension.sgml
doc/src/sgml/ref/alter_operator.sgml
doc/src/sgml/ref/alter_opfamily.sgml
doc/src/sgml/ref/comment.sgml
doc/src/sgml/ref/create_opclass.sgml
doc/src/sgml/ref/create_operator.sgml
doc/src/sgml/ref/drop_operator.sgml
doc/src/sgml/syntax.sgml
doc/src/sgml/typeconv.sgml
doc/src/sgml/xoper.sgml
src/backend/catalog/namespace.c
src/backend/catalog/pg_operator.c
src/backend/commands/operatorcmds.c
src/backend/nodes/print.c
src/backend/parser/gram.y
src/backend/parser/parse_expr.c
src/backend/parser/parse_oper.c
src/backend/utils/adt/ruleutils.c
src/bin/pg_dump/pg_dump.c
src/bin/pg_upgrade/check.c
src/bin/psql/describe.c
src/include/catalog/catversion.h
src/include/catalog/pg_operator.h
src/include/parser/parse_oper.h
src/test/regress/expected/create_operator.out
src/test/regress/expected/opr_sanity.out
src/test/regress/sql/create_operator.sql
src/test/regress/sql/opr_sanity.sql
src/tutorial/complex.source
src/tutorial/syscat.source