postgresql/src/pl/plpython/sql
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
..
plpython_call.sql Reconsider the handling of procedure OUT parameters. 2021-06-10 17:11:36 -04:00
plpython_composite.sql Give a hint, when [] is incorrectly used for a composite type in array. 2016-10-26 10:56:56 +03:00
plpython_do.sql PL/Python: Adjust the regression tests for Python 3.4 2014-04-29 22:16:16 -04:00
plpython_drop.sql Create extension infrastructure for the core procedural languages. 2011-03-04 21:51:14 -05:00
plpython_ereport.sql Modernize Python exception syntax in tests 2020-01-08 22:47:22 +01:00
plpython_error.sql Modernize Python exception syntax in tests 2020-01-08 22:47:22 +01:00
plpython_global.sql Make PL/Python tests more compatible with Python 3 2009-08-24 20:25:25 +00:00
plpython_import.sql Modernize Python exception syntax in tests 2020-01-08 22:47:22 +01:00
plpython_newline.sql Remove useless whitespace at end of lines 2010-11-23 22:34:55 +02:00
plpython_params.sql Modernize Python exception syntax in tests 2020-01-08 22:47:22 +01:00
plpython_populate.sql Remove extra newlines at end and beginning of files, add missing newlines 2010-08-19 05:57:36 +00:00
plpython_quote.sql Add PL/Python functions for quoting strings 2011-02-22 23:41:23 +02:00
plpython_record.sql PL/Python: Accept strings in functions returning composite types 2012-04-26 21:03:48 +03:00
plpython_schema.sql Remove useless whitespace at end of lines 2010-11-23 22:34:55 +02:00
plpython_setof.sql Fix PL/Python for recursion and interleaved set-returning functions. 2016-04-05 14:51:19 -04:00
plpython_spi.sql Modernize Python exception syntax in tests 2020-01-08 22:47:22 +01:00
plpython_subtransaction.sql Fix subtransaction test for Python 3.10 2021-06-05 07:16:34 +02:00
plpython_test.sql Format PL/Python module contents test vertically 2016-10-27 15:41:29 -04:00
plpython_transaction.sql Allow committing inside cursor loop 2018-03-28 19:03:26 -04:00
plpython_trigger.sql Generated columns 2019-03-30 08:15:57 +01:00
plpython_types.sql Modernize Python exception syntax in tests 2020-01-08 22:47:22 +01:00
plpython_unicode.sql Make plpython_unicode regression test work in more database encodings. 2014-06-03 12:01:54 -04:00
plpython_void.sql Split the plpython regression test into test cases arranged by topic, instead 2009-08-12 16:37:26 +00:00