set_deparse_context_plan() set the aliases for OLD and NEW in RETURNING when EXPLAIN printed a ModifyTable, but that's the wrong place: they should be set in set_deparse_plan() like other plan-node-specific fields. So they were not changed when push_ancestor_plan() moved to the ancestor ModifyTable to print a Param of a SubPlan in its RETURNING list, and the aliases of some previously-printed ModifyTable could be used instead. It seems possible that we'd also fail to print an alias at all, since get_variable() is unfazed by obtaining a NULL refname. That shouldn't happen for RETURNING variables, so complain. Author: Henson Choi <assam258@gmail.com> Reviewed-by: Tom Lane <tgl@sss.pgh.pa.us> Discussion: https://postgr.es/m/CAAAe_zAUb_XydapJqUk7O8o2crJa7xbxX=KvSi3nY9h98OcN7g@mail.gmail.com Backpatch-through: 18
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.
Copyright and license information can be found in the file COPYRIGHT.
General documentation about this version of PostgreSQL can be found at https://www.postgresql.org/docs/devel/. In particular, information about building PostgreSQL from the source code can be found at https://www.postgresql.org/docs/devel/installation.html.
The latest version of this software, and related software, may be obtained at https://www.postgresql.org/download/. For more information look at our web site located at https://www.postgresql.org/.