Brandon Craig Rhodes <[EMAIL PROTECTED]> writes:
> While learning how to read query trees, I have been puzzled by the
> assertion in the manual that the :resultRelations of an INSERT holds
> `the table (or view!) where the changes take effect,' because in all
> of the INSERTs I have generated the resultRelation in fact appears
> empty,
You seem to be confusing resultRelation with resultRelations. The
documentation is speaking of the former. Of the latter, parsenodes.h
says
/*
* If the resultRelation turns out to be the parent of an inheritance
* tree, the planner will add all the child tables to the rtable and
* store a list of the rtindexes of all the result relations here.
* This is done at plan time, not parse time, since we don't want to
* commit to the exact set of child tables at parse time. This field
* ought to go in some sort of TopPlan plan node, not in the Query.
*/
List *resultRelations; /* integer list of RT indexes, or NIL */
Note in particular that this only gets set when the target is an
inheritance tree --- which, by definition, it never is for INSERT.
regards, tom lane
---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddressHere" to [EMAIL PROTECTED])