Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 08a9869

Browse files
committed
Update comments for rewriteTargetListIU().
This function's behavior for UPDATE on a trigger-updatable view was justified by analogy to what preptlist.c used to do for UPDATE on regular tables. Since preptlist.c hasn't done that since 86dc900, that argument is no longer sensible, let alone convincing. I think we do still need it to act that way, so update the comment to explain why.
1 parent 59773da commit 08a9869

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

src/backend/rewrite/rewriteHandler.c

+4-6
Original file line numberDiff line numberDiff line change
@@ -681,12 +681,10 @@ adjustJoinTreeList(Query *parsetree, bool removert, int rt_index)
681681
*
682682
* 2. For an UPDATE on a trigger-updatable view, add tlist entries for any
683683
* unassigned-to attributes, assigning them their old values. These will
684-
* later get expanded to the output values of the view. (This is equivalent
685-
* to what the planner's expand_targetlist() will do for UPDATE on a regular
686-
* table, but it's more convenient to do it here while we still have easy
687-
* access to the view's original RT index.) This is only necessary for
688-
* trigger-updatable views, for which the view remains the result relation of
689-
* the query. For auto-updatable views we must not do this, since it might
684+
* later get expanded to the output values of the view. This is only needed
685+
* for trigger-updatable views, for which the view remains the result relation
686+
* of the query; without it, we would not have a complete "new tuple" to pass
687+
* to triggers. For auto-updatable views we must not do this, since it might
690688
* add assignments to non-updatable view columns. For rule-updatable views it
691689
* is unnecessary extra work, since the query will be rewritten with a
692690
* different result relation which will be processed when we recurse via

0 commit comments

Comments
 (0)