postgresql/src/include
Tom Lane 913bbd88dc Improve the handling of result type coercions in SQL functions.
Use the parser's standard type coercion machinery to convert the
output column(s) of a SQL function's final SELECT or RETURNING
to the type(s) they should have according to the function's declared
result type.  We'll allow any case where an assignment-level
coercion is available.  Previously, we failed unless the required
coercion was a binary-compatible one (and the documentation ignored
this, falsely claiming that the types must match exactly).

Notably, the coercion now accounts for typmods, so that cases where
a SQL function is declared to return a composite type whose columns
are typmod-constrained now behave as one would expect.  Arguably
this aspect is a bug fix, but the overall behavioral change here
seems too large to consider back-patching.

A nice side-effect is that functions can now be inlined in a
few cases where we previously failed to do so because of type
mismatches.

Discussion: https://postgr.es/m/18929.1574895430@sss.pgh.pa.us
2020-01-08 11:07:59 -05:00
..
access tableam: New callback relation_fetch_toast_slice. 2020-01-07 14:36:38 -05:00
bootstrap Update copyrights for 2020 2020-01-01 12:21:45 -05:00
catalog Add functions min_scale(numeric) and trim_scale(numeric). 2020-01-06 12:13:53 -05:00
commands Make better use of ParseState in ProcessUtility 2020-01-04 13:12:41 +01:00
common Update copyrights for 2020 2020-01-01 12:21:45 -05:00
datatype Update copyrights for 2020 2020-01-01 12:21:45 -05:00
executor Improve the handling of result type coercions in SQL functions. 2020-01-08 11:07:59 -05:00
fe_utils Update copyrights for 2020 2020-01-01 12:21:45 -05:00
foreign Update copyrights for 2020 2020-01-01 12:21:45 -05:00
jit Update copyrights for 2020 2020-01-01 12:21:45 -05:00
lib Skip memcpy(x, x) in qunique(). 2020-01-04 11:31:42 -08:00
libpq Update copyrights for 2020 2020-01-01 12:21:45 -05:00
mb Update copyrights for 2020 2020-01-01 12:21:45 -05:00
nodes Update copyrights for 2020 2020-01-01 12:21:45 -05:00
optimizer Update copyrights for 2020 2020-01-01 12:21:45 -05:00
parser Make parser rely more heavily on the ParseNamespaceItem data structure. 2020-01-02 11:29:01 -05:00
partitioning Update copyrights for 2020 2020-01-01 12:21:45 -05:00
port Update copyrights for 2020 2020-01-01 12:21:45 -05:00
portability Update copyrights for 2020 2020-01-01 12:21:45 -05:00
postmaster Update copyrights for 2020 2020-01-01 12:21:45 -05:00
regex Update copyrights for 2020 2020-01-01 12:21:45 -05:00
replication Update copyrights for 2020 2020-01-01 12:21:45 -05:00
rewrite Update copyrights for 2020 2020-01-01 12:21:45 -05:00
snowball Update copyrights for 2020 2020-01-01 12:21:45 -05:00
statistics Update copyrights for 2020 2020-01-01 12:21:45 -05:00
storage Update copyrights for 2020 2020-01-01 12:21:45 -05:00
tcop Update copyrights for 2020 2020-01-01 12:21:45 -05:00
tsearch Update copyrights for 2020 2020-01-01 12:21:45 -05:00
utils Update copyrights for 2020 2020-01-01 12:21:45 -05:00
.gitignore Refactor dlopen() support 2018-09-06 11:33:04 +02:00
c.h Update copyrights for 2020 2020-01-01 12:21:45 -05:00
fmgr.h Update copyrights for 2020 2020-01-01 12:21:45 -05:00
funcapi.h Update copyrights for 2020 2020-01-01 12:21:45 -05:00
getaddrinfo.h Update copyrights for 2020 2020-01-01 12:21:45 -05:00
getopt_long.h Update copyrights for 2020 2020-01-01 12:21:45 -05:00
Makefile Get rid of jsonpath_gram.h and jsonpath_scanner.h 2019-03-20 11:13:34 +03:00
miscadmin.h Update copyrights for 2020 2020-01-01 12:21:45 -05:00
pg_config.h.in Fix handling of OpenSSL's SSL_clear_options 2019-12-06 15:13:55 +09:00
pg_config_ext.h.in Autoconfiscate selection of 64-bit int type for 64-bit large object API. 2012-10-07 21:52:43 -04:00
pg_config_manual.h Update copyrights for 2020 2020-01-01 12:21:45 -05:00
pg_getopt.h Update copyrights for 2020 2020-01-01 12:21:45 -05:00
pg_trace.h Update copyrights for 2020 2020-01-01 12:21:45 -05:00
pgstat.h Update copyrights for 2020 2020-01-01 12:21:45 -05:00
pgtar.h Update copyrights for 2020 2020-01-01 12:21:45 -05:00
pgtime.h Update copyrights for 2020 2020-01-01 12:21:45 -05:00
port.h Update copyrights for 2020 2020-01-01 12:21:45 -05:00
postgres.h Update copyrights for 2020 2020-01-01 12:21:45 -05:00
postgres_ext.h Phase 2 of pgindent updates. 2017-06-21 15:19:25 -04:00
postgres_fe.h Update copyrights for 2020 2020-01-01 12:21:45 -05:00
rusagestub.h Update copyrights for 2020 2020-01-01 12:21:45 -05:00
windowapi.h Update copyrights for 2020 2020-01-01 12:21:45 -05:00