forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit04942bf
committed
Remove rewriteTargetListIU's expansion of view targetlists in UPDATE.
Commit2ec993a, which added triggers on views, modified the rewriterto add dummy entries like "SET x = x" for all columns that weren'tactually being updated by the user in any UPDATE directed at a view.That was needed at the time to produce a complete "NEW" row to passto the trigger. Later it was found to cause problems for ordinaryupdatable views, so commitcab5dc5 restricted it to happen only fortrigger-updatable views. But in the wake of commit86dc900, wereally don't need it at all. nodeModifyTable.c populates the trigger"OLD" row from the whole-row variable that is generated for the view,and then it computes the "NEW" row using that old row and the UPDATEtargetlist. So there is no need for the UPDATE tlist to have dummyentries, any more than it needs them for regular tables or othertypes of views.(The comments for rewriteTargetListIU suggest that we must do thisfor correct expansion of NEW references in rules, but I now thinkthat that was just lazy comment editing in2ec993a. If we didn'tneed it for rules on views before there were triggers, we don't needit after that.)This essentially propagates86dc900's decision that we don't needdummy column updates into the view case. Aside from making thedifferent cases more uniform and hence possibly forestalling futurebugs, it ought to save a little bit of rewriter/planner effort.Discussion:https://postgr.es/m/2181213.1619397634@sss.pgh.pa.us1 parent79a5928 commit04942bf
1 file changed
+4
-38
lines changedLines changed: 4 additions & 38 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
679 | 679 |
| |
680 | 680 |
| |
681 | 681 |
| |
682 |
| - | |
683 |
| - | |
684 |
| - | |
685 |
| - | |
686 |
| - | |
687 |
| - | |
688 |
| - | |
689 |
| - | |
690 |
| - | |
691 |
| - | |
692 |
| - | |
693 |
| - | |
| 682 | + | |
694 | 683 |
| |
695 | 684 |
| |
696 | 685 |
| |
697 | 686 |
| |
698 | 687 |
| |
699 | 688 |
| |
700 | 689 |
| |
701 |
| - | |
| 690 | + | |
702 | 691 |
| |
703 | 692 |
| |
704 |
| - | |
705 |
| - | |
| 693 | + | |
| 694 | + | |
706 | 695 |
| |
707 | 696 |
| |
708 | 697 |
| |
| |||
984 | 973 |
| |
985 | 974 |
| |
986 | 975 |
| |
987 |
| - | |
988 |
| - | |
989 |
| - | |
990 |
| - | |
991 |
| - | |
992 |
| - | |
993 |
| - | |
994 |
| - | |
995 |
| - | |
996 |
| - | |
997 |
| - | |
998 |
| - | |
999 |
| - | |
1000 |
| - | |
1001 |
| - | |
1002 |
| - | |
1003 |
| - | |
1004 |
| - | |
1005 |
| - | |
1006 |
| - | |
1007 |
| - | |
1008 |
| - | |
1009 |
| - | |
1010 | 976 |
| |
1011 | 977 |
| |
1012 | 978 |
| |
|
0 commit comments
Comments
(0)