Make the world very nearly safe for composite-type columns in tables.
1. Solve the problem of not having TOAST references hiding inside composite values by establishing the rule that toasting only goes one level deep: a tuple can contain toasted fields, but a composite-type datum that is to be inserted into a tuple cannot. Enforcing this in heap_formtuple is relatively cheap and it avoids a large increase in the cost of running the tuptoaster during final storage of a row. 2. Fix some interesting problems in expansion of inherited queries that reference whole-row variables. We never really did this correctly before, but it's now relatively painless to solve by expanding the parent's whole-row Var into a RowExpr() selecting the proper columns from the child. If you dike out the preventive check in CheckAttributeType(), composite-type columns now seem to actually work. However, we surely cannot ship them like this --- without I/O for composite types, you can't get pg_dump to dump tables containing them. So a little more work still to do.
Showing
- src/backend/access/common/heaptuple.c 29 additions, 6 deletionssrc/backend/access/common/heaptuple.c
- src/backend/access/heap/tuptoaster.c 128 additions, 5 deletionssrc/backend/access/heap/tuptoaster.c
- src/backend/optimizer/path/allpaths.c 9 additions, 5 deletionssrc/backend/optimizer/path/allpaths.c
- src/backend/optimizer/path/costsize.c 10 additions, 3 deletionssrc/backend/optimizer/path/costsize.c
- src/backend/optimizer/path/pathkeys.c 3 additions, 2 deletionssrc/backend/optimizer/path/pathkeys.c
- src/backend/optimizer/prep/prepunion.c 135 additions, 33 deletionssrc/backend/optimizer/prep/prepunion.c
- src/backend/optimizer/util/relnode.c 4 additions, 1 deletionsrc/backend/optimizer/util/relnode.c
- src/backend/optimizer/util/tlist.c 19 additions, 3 deletionssrc/backend/optimizer/util/tlist.c
- src/backend/utils/cache/typcache.c 20 additions, 6 deletionssrc/backend/utils/cache/typcache.c
- src/include/access/tuptoaster.h 13 additions, 1 deletionsrc/include/access/tuptoaster.h
- src/include/nodes/relation.h 2 additions, 1 deletionsrc/include/nodes/relation.h
- src/include/utils/typcache.h 4 additions, 1 deletionsrc/include/utils/typcache.h
Loading
Please register or sign in to comment