]> granicus.if.org Git - postgresql/commit
Provide some rather hokey ways for EXPLAIN to print FieldStore and assignment
authorTom Lane <tgl@sss.pgh.pa.us>
Thu, 18 Feb 2010 22:43:39 +0000 (22:43 +0000)
committerTom Lane <tgl@sss.pgh.pa.us>
Thu, 18 Feb 2010 22:43:39 +0000 (22:43 +0000)
commita8d1624431c656289d1359511970c269930b2912
tree3e1f4b3a68a41934aa7684c0762bd07f4b59d995
parentdfb3bc020dc2709aa78156fef63bfa60f6fc8b32
Provide some rather hokey ways for EXPLAIN to print FieldStore and assignment
ArrayRef expressions that are not in the immediate context of an INSERT or
UPDATE targetlist.  Such cases never arise in stored rules, so ruleutils.c
hadn't tried to handle them.  However, they do occur in the targetlists of
plans derived from such statements, and now that EXPLAIN VERBOSE tries to
print targetlists, we need some way to deal with the case.

I chose to represent an assignment ArrayRef as "array[subscripts] := source",
which is fairly reasonable and doesn't omit any information.  However,
FieldStore is problematic because the planner will fold multiple assignments
to fields of the same composite column into one FieldStore, resulting in a
structure that is hard to understand at all, let alone display comprehensibly.
So in that case I punted and just made it print the source expression(s).

Backpatch to 8.4 --- the lack of functionality exists in older releases,
but doesn't seem to be important for lack of anything that would call it.
src/backend/utils/adt/ruleutils.c