diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2019-02-22 12:23:00 -0500 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2019-02-22 12:23:00 -0500 |
commit | 0fe3f6dd45c95f82bf6dcd98b4f9e029ce433ce0 (patch) | |
tree | 2377cab6689b69e9f2fde8f95f6178a79ec594d1 /src/backend/utils/adt/network_gist.c | |
parent | 545928bbbf9c8c2bfa748702d40a43d6a560216b (diff) | |
download | postgresql-0fe3f6dd45c95f82bf6dcd98b4f9e029ce433ce0.tar.gz postgresql-0fe3f6dd45c95f82bf6dcd98b4f9e029ce433ce0.zip |
Fix plan created for inherited UPDATE/DELETE with all tables excluded.
In the case where inheritance_planner() finds that every table has
been excluded by constraints, it thought it could get away with
making a plan consisting of just a dummy Result node. While certainly
there's no updating or deleting to be done, this had two user-visible
problems: the plan did not report the correct set of output columns
when a RETURNING clause was present, and if there were any
statement-level triggers that should be fired, it didn't fire them.
Hence, rather than only generating the dummy Result, we need to
stick a valid ModifyTable node on top, which requires a tad more
effort here.
It's been broken this way for as long as inheritance_planner() has
known about deleting excluded subplans at all (cf commit 635d42e9c),
so back-patch to all supported branches.
Amit Langote and Tom Lane, per a report from Petr Fedorov.
Discussion: https://postgr.es/m/5da6f0f0-1364-1876-6978-907678f89a3e@phystech.edu
Diffstat (limited to 'src/backend/utils/adt/network_gist.c')
0 files changed, 0 insertions, 0 deletions