Commit 28f84f7
committed
Lock table in DROP STATISTICS
The DROP STATISTICS code failed to properly lock the table, leading to
ERROR: tuple concurrently deleted
when executed concurrently with ANALYZE.
Fixed by modifying RemoveStatisticsById() to acquire the same lock as
ANALYZE. This function is called only by DROP STATISTICS, as ANALYZE
calls RemoveStatisticsDataById() directly.
Reported by Justin Pryzby, fix by me. Backpatch through 12. The code was
like this since it was introduced in 10, but older releases are EOL.
Reported-by: Justin Pryzby
Reviewed-by: Tom Lane
Backpatch-through: 12
Discussion: https://postgr.es/m/ZUuk-8CfbYeq6g_u@pryzbyj20231 parent b218fbb commit 28f84f7
1 file changed
+15
-8
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
734 | 734 | | |
735 | 735 | | |
736 | 736 | | |
| 737 | + | |
737 | 738 | | |
738 | 739 | | |
739 | 740 | | |
740 | 741 | | |
741 | | - | |
742 | | - | |
743 | | - | |
744 | | - | |
745 | | - | |
746 | | - | |
747 | | - | |
748 | | - | |
749 | 742 | | |
750 | 743 | | |
751 | 744 | | |
| |||
760 | 753 | | |
761 | 754 | | |
762 | 755 | | |
| 756 | + | |
| 757 | + | |
| 758 | + | |
| 759 | + | |
| 760 | + | |
| 761 | + | |
| 762 | + | |
| 763 | + | |
| 764 | + | |
| 765 | + | |
| 766 | + | |
763 | 767 | | |
764 | 768 | | |
765 | 769 | | |
766 | 770 | | |
767 | 771 | | |
768 | 772 | | |
| 773 | + | |
| 774 | + | |
| 775 | + | |
769 | 776 | | |
770 | 777 | | |
771 | 778 | | |
| |||
0 commit comments