forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit187682c
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 matview query and those internal aliasesconflict.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 parentcb3cffe commit187682c
1 file changed
+18
-18
lines changedOriginal file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
629 | 629 |
| |
630 | 630 |
| |
631 | 631 |
| |
632 |
| - | |
633 |
| - | |
634 |
| - | |
635 |
| - | |
636 |
| - | |
637 |
| - | |
| 632 | + | |
| 633 | + | |
| 634 | + | |
| 635 | + | |
| 636 | + | |
| 637 | + | |
638 | 638 |
| |
639 | 639 |
| |
640 | 640 |
| |
| |||
662 | 662 |
| |
663 | 663 |
| |
664 | 664 |
| |
665 |
| - | |
666 |
| - | |
| 665 | + | |
| 666 | + | |
667 | 667 |
| |
668 | 668 |
| |
669 | 669 |
| |
| |||
756 | 756 |
| |
757 | 757 |
| |
758 | 758 |
| |
759 |
| - | |
| 759 | + | |
760 | 760 |
| |
761 |
| - | |
| 761 | + | |
762 | 762 |
| |
763 | 763 |
| |
764 | 764 |
| |
| |||
786 | 786 |
| |
787 | 787 |
| |
788 | 788 |
| |
789 |
| - | |
790 |
| - | |
| 789 | + | |
| 790 | + | |
791 | 791 |
| |
792 | 792 |
| |
793 | 793 |
| |
| |||
813 | 813 |
| |
814 | 814 |
| |
815 | 815 |
| |
816 |
| - | |
817 |
| - | |
818 |
| - | |
819 |
| - | |
| 816 | + | |
| 817 | + | |
| 818 | + | |
| 819 | + | |
820 | 820 |
| |
821 | 821 |
| |
822 | 822 |
| |
823 | 823 |
| |
824 | 824 |
| |
825 | 825 |
| |
826 | 826 |
| |
827 |
| - | |
828 |
| - | |
| 827 | + | |
| 828 | + | |
829 | 829 |
| |
830 | 830 |
| |
831 | 831 |
| |
|
0 commit comments
Comments
(0)