Re: auto_explain causes regression failures

Tom Lane <tgl@sss.pgh.pa.us>

From: Tom Lane <tgl@sss.pgh.pa.us>
To: Andrew Dunstan <andrew@dunslane.net>
Cc: PostgreSQL-development <pgsql-hackers@postgresql.org>
Date: 2010-02-18T03:17:21Z
Lists: pgsql-hackers
I wrote:
> If you're lost about the point here, it's this: an ArrayExpr can
> represent the result of an array assignment.  For example, given
> UPDATE foo SET a[42] = x, what is generated is an ArrayExpr
> with refexpr = a, refupperindexpr = 42, refassgnexpr = x.
> On execution that generates the updated array value that needs to
> get stored back into the "a" column.  How would you like to print
> that in EXPLAIN?  Same deal for FieldStore: it can represent generating
> the new value of a composite column after replacing one field.

After thinking about this for awhile, the best representation I can
come up with is to let the EXPLAIN output look like an UPDATE
assignment.  That is, from something like

	UPDATE foo SET arraycol[42] = x WHERE ...

an EXPLAIN VERBOSE would include this in the targetlist display:

	Output: ... , arraycol[42] = x , ...

An alternative possibility is to strip the indirection node(s) and
just show "x"; but that seems to leave a good deal of information
hidden, especially if the subscript expressions are complicated.

Objections, better ideas?

			regards, tom lane