postgresql/src/include/optimizer
Tom Lane e56bce5d43 Reconsider the handling of procedure OUT parameters.
Commit 2453ea142 redefined pg_proc.proargtypes to include the types of
OUT parameters, for procedures only.  While that had some advantages
for implementing the SQL-spec behavior of DROP PROCEDURE, it was pretty
disastrous from a number of other perspectives.  Notably, since the
primary key of pg_proc is name + proargtypes, this made it possible to
have multiple procedures with identical names + input arguments and
differing output argument types.  That would make it impossible to call
any one of the procedures by writing just NULL (or "?", or any other
data-type-free notation) for the output argument(s).  The change also
seems likely to cause grave confusion for client applications that
examine pg_proc and expect the traditional definition of proargtypes.

Hence, revert the definition of proargtypes to what it was, and
undo a number of complications that had been added to support that.

To support the SQL-spec behavior of DROP PROCEDURE, when there are
no argmode markers in the command's parameter list, we perform the
lookup both ways (that is, matching against both proargtypes and
proallargtypes), succeeding if we get just one unique match.
In principle this could result in ambiguous-function failures
that would not happen when using only one of the two rules.
However, overloading of procedure names is thought to be a pretty
rare usage, so this shouldn't cause many problems in practice.
Postgres-specific code such as pg_dump can defend against any
possibility of such failures by being careful to specify argmodes
for all procedure arguments.

This also fixes a few other bugs in the area of CALL statements
with named parameters, and improves the documentation a little.

catversion bump forced because the representation of procedures
with OUT arguments changes.

Discussion: https://postgr.es/m/3742981.1621533210@sss.pgh.pa.us
2021-06-10 17:11:36 -04:00
..
appendinfo.h Rework planning and execution of UPDATE and DELETE. 2021-03-31 11:52:37 -04:00
clauses.h Revert "Enable parallel SELECT for "INSERT INTO ... SELECT ..."." 2021-03-24 11:29:15 +05:30
cost.h Add Result Cache executor node (take 2) 2021-04-02 14:10:56 +13:00
geqo_copy.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
geqo_gene.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
geqo_misc.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
geqo_mutation.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
geqo_pool.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
geqo_random.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
geqo_recombination.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
geqo_selection.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
geqo.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
inherit.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
joininfo.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
optimizer.h Reconsider the handling of procedure OUT parameters. 2021-06-10 17:11:36 -04:00
orclauses.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
paramassign.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
pathnode.h Add Result Cache executor node (take 2) 2021-04-02 14:10:56 +13:00
paths.h Rename find_em_expr_usable_for_sorting_rel. 2021-04-20 11:37:36 -04:00
placeholder.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
plancat.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
planmain.h Fix pull_varnos' miscomputation of relids set for a PlaceHolderVar. 2021-01-21 15:37:23 -05:00
planner.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
prep.h Fix mishandling of resjunk columns in ON CONFLICT ... UPDATE tlists. 2021-05-10 11:02:29 -04:00
restrictinfo.h Fix pull_varnos' miscomputation of relids set for a PlaceHolderVar. 2021-01-21 15:37:23 -05:00
subselect.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
tlist.h Fix planner failure in some cases of sorting by an aggregate. 2021-04-20 11:32:02 -04:00