Instead of supposing (wrongly, in the general case) that the rowtype
Tom Lane <tgl@sss.pgh.pa.us>
Instead of supposing (wrongly, in the general case) that the rowtype of an inheritance child table is binary-compatible with the rowtype of its parent, invent an expression node type that does the conversion correctly. Fixes the new bug exhibited by Kris Shannon as well as a lot of old bugs that would only show up when using multiple inheritance or after altering the parent table.
Files
| Path | Change | +/− |
|---|---|---|
| src/backend/executor/execQual.c | modified | +137 −2 |
| src/backend/nodes/copyfuncs.c | modified | +19 −1 |
| src/backend/nodes/equalfuncs.c | modified | +22 −1 |
| src/backend/nodes/outfuncs.c | modified | +14 −1 |
| src/backend/nodes/readfuncs.c | modified | +18 −1 |
| src/backend/optimizer/prep/prepjointree.c | modified | +8 −1 |
| src/backend/optimizer/prep/prepunion.c | modified | +21 −47 |
| src/backend/optimizer/util/clauses.c | modified | +25 −4 |
| src/backend/parser/parse_coerce.c | modified | +12 −7 |
| src/backend/parser/parse_expr.c | modified | +5 −1 |
| src/backend/utils/adt/ruleutils.c | modified | +28 −1 |
| src/include/nodes/execnodes.h | modified | +18 −1 |
| src/include/nodes/nodes.h | modified | +3 −1 |
| src/include/nodes/primnodes.h | modified | +22 −1 |
| src/pl/plpgsql/src/pl_exec.c | modified | +4 −1 |