mirror of
https://github.com/postgres/postgres.git
synced 2026-10-23 13:29:09 +03:00
8113841f0d17082865b38c272eafa95f04c1f95d
If the target relation of UPDATE, DELETE, or MERGE has an alias, we printed that "bare" (without AS or forced quoting), the same as we do in FROM. However, if that alias is "set", there's an ambiguity with the SET keyword that must follow the relation specification. The parser would choose the wrong interpretation, so that the dumped query would fail to reload. The least surprising and most future-proof fix seems to be to always print AS in these contexts, as we already did in INSERT. Also, we were insufficiently careful about parenthesizing the left-hand argument of a SubLink (IN, op ANY/ALL, or row comparison), so that the printed expression might not parse back with the intended meaning depending on operator precedence. This is only a problem in "pretty-print" mode, since non-pretty mode fully parenthesizes every operator. So it isn't a hazard for pg_dump, but it still seems like something to fix. To do so, switch to using get_rule_expr_paren. Presently that will add parens in some cases where it wouldn't really be necessary, but that's better than the reverse, and it arguably is helpful for readability anyway. Author: Henson Choi <assam258@gmail.com> Reviewed-by: Tom Lane <tgl@sss.pgh.pa.us> Discussion: https://postgr.es/m/CAAAe_zDqXin5NeB5atRCbZqUdcMOeyXRqhan+tVp0F30OCURnw@mail.gmail.com Discussion: https://postgr.es/m/CAAAe_zCy+D45Qd_br484F+V34y0BVA=hp_7cb=u6HysyMkE3UQ@mail.gmail.com Backpatch-through: 14
PostgreSQL Database Management System ===================================== This directory contains the source code distribution of the PostgreSQL database management system. PostgreSQL is an advanced object-relational database management system that supports an extended subset of the SQL standard, including transactions, foreign keys, subqueries, triggers, user-defined types and functions. This distribution also contains C language bindings. PostgreSQL has many language interfaces, many of which are listed here: https://www.postgresql.org/download/ See the file INSTALL for instructions on how to build and install PostgreSQL. That file also lists supported operating systems and hardware platforms and contains information regarding any other software packages that are required to build or run the PostgreSQL system. Copyright and license information can be found in the file COPYRIGHT. A comprehensive documentation set is included in this distribution; it can be read as described in the installation instructions. The latest version of this software may be obtained at https://www.postgresql.org/download/. For more information look at our web site located at https://www.postgresql.org/.
Languages
C
83.9%
PLpgSQL
6.2%
Perl
5.4%
Yacc
1.2%
Meson
0.7%
Other
2.4%