postgresql/contrib/postgres_fdw
Tom Lane 7294f99a0b In postgres_fdw, don't try to ship MULTIEXPR updates to remote server.
In a statement like "UPDATE remote_tab SET (x,y) = (SELECT ...)",
we'd conclude that the statement could be directly executed remotely,
because the sub-SELECT is in a resjunk tlist item that's not examined
for shippability.  Currently that ends up crashing if the sub-SELECT
contains any remote Vars.  Prevent the crash by deeming MULTIEXEC
Params to be unshippable.

This is a bit of a brute-force solution, since if the sub-SELECT
*doesn't* contain any remote Vars, the current execution technology
would work; but that's not a terribly common use-case for this syntax,
I think.  In any case, we generally don't try to ship sub-SELECTs, so
it won't surprise anybody that this doesn't end up as a remote direct
update.  I'd be inclined to see if that general limitation can be fixed
before worrying about this case further.

Per report from Lukáš Sobotka.

Back-patch to 9.6.  9.5 had MULTIEXPR, but we didn't try to perform
remote direct updates then, so the case didn't arise anyway.

Discussion: https://postgr.es/m/CAJif3k+iA_ekBB5Zw2hDBaE1wtiQa4LH4_JUXrrMGwTrH0J01Q@mail.gmail.com
2020-01-26 14:31:08 -05:00
..
expected In postgres_fdw, don't try to ship MULTIEXPR updates to remote server. 2020-01-26 14:31:08 -05:00
sql In postgres_fdw, don't try to ship MULTIEXPR updates to remote server. 2020-01-26 14:31:08 -05:00
.gitignore Add postgres_fdw contrib module. 2013-02-21 05:27:16 -05:00
Makefile Prevent accidental linking of system-supplied copies of libpq.so etc. 2018-04-03 16:26:05 -04:00
connection.c postgres_fdw: Fix error message for PREPARE TRANSACTION. 2019-11-08 17:00:31 +09:00
deparse.c In postgres_fdw, don't try to ship MULTIEXPR updates to remote server. 2020-01-26 14:31:08 -05:00
option.c Update copyright for 2019 2019-01-02 12:44:25 -05:00
postgres_fdw--1.0.sql Add postgres_fdw contrib module. 2013-02-21 05:27:16 -05:00
postgres_fdw.c postgres_fdw: Fix costing of pre-sorted foreign paths with local stats. 2019-06-14 20:49:59 +09:00
postgres_fdw.control Add postgres_fdw contrib module. 2013-02-21 05:27:16 -05:00
postgres_fdw.h pgindent run prior to branching v12. 2019-07-01 12:37:52 -04:00
shippable.c Update copyright for 2019 2019-01-02 12:44:25 -05:00