forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit75d66d1
committed
Reduce risks of conflicts in internal queries of REFRESH MATVIEW CONCURRENTLY
The internal SQL queries used by REFRESH MATERIALIZED VIEW CONCURRENTLYinclude some aliases for its diff and temporary relations withrather-generic names: diff, newdata, newdata2 and mv. Depending on thequeries used for the materialized view, using CONCURRENTLY could lead tosome internal failures if the query and those internal aliases conflict.Those names have been chosen in841c29c. This commit switches insteadto a naming pattern which is less likely going to cause conflicts, basedon an idea from Thomas Munro, by appending _$ to those aliases. This isnot perfect as those new names could still conflict, but at least it hasthe advantage to keep the code readable and simple while reducing thelikelihood of conflicts to be close to zero.Reported-by: Mathis RudolfAuthor: Bharath RupireddyReviewed-by: Bernd Helmle, Thomas Munro, Michael PaquierDiscussion:https://postgr.es/m/109c267a-10d2-3c53-b60e-720fcf44d9e8@credativ.deBackpatch-through: 9.61 parent9d66067 commit75d66d1
1 file changed
+18
-18
lines changedOriginal file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
618 | 618 |
| |
619 | 619 |
| |
620 | 620 |
| |
621 |
| - | |
622 |
| - | |
623 |
| - | |
624 |
| - | |
625 |
| - | |
626 |
| - | |
| 621 | + | |
| 622 | + | |
| 623 | + | |
| 624 | + | |
| 625 | + | |
| 626 | + | |
627 | 627 |
| |
628 | 628 |
| |
629 | 629 |
| |
| |||
651 | 651 |
| |
652 | 652 |
| |
653 | 653 |
| |
654 |
| - | |
655 |
| - | |
| 654 | + | |
| 655 | + | |
656 | 656 |
| |
657 | 657 |
| |
658 | 658 |
| |
| |||
745 | 745 |
| |
746 | 746 |
| |
747 | 747 |
| |
748 |
| - | |
| 748 | + | |
749 | 749 |
| |
750 |
| - | |
| 750 | + | |
751 | 751 |
| |
752 | 752 |
| |
753 | 753 |
| |
| |||
775 | 775 |
| |
776 | 776 |
| |
777 | 777 |
| |
778 |
| - | |
779 |
| - | |
| 778 | + | |
| 779 | + | |
780 | 780 |
| |
781 | 781 |
| |
782 | 782 |
| |
| |||
802 | 802 |
| |
803 | 803 |
| |
804 | 804 |
| |
805 |
| - | |
806 |
| - | |
807 |
| - | |
808 |
| - | |
| 805 | + | |
| 806 | + | |
| 807 | + | |
| 808 | + | |
809 | 809 |
| |
810 | 810 |
| |
811 | 811 |
| |
812 | 812 |
| |
813 | 813 |
| |
814 | 814 |
| |
815 | 815 |
| |
816 |
| - | |
817 |
| - | |
| 816 | + | |
| 817 | + | |
818 | 818 |
| |
819 | 819 |
| |
820 | 820 |
| |
|
0 commit comments
Comments
(0)