forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commitfa61313
committed
In REASSIGN OWNED of a database, lock the tuple as mandated.
Commitaac2c9b mandated such lockingand attempted to fulfill that mandate, but it missed REASSIGN OWNED.Hence, it remained possible to lose VACUUM's inplace update ofdatfrozenxid if a REASSIGN OWNED processed that database at the sametime. This didn't affect the other inplace-updated catalog, pg_class.For pg_class, REASSIGN OWNED calls ATExecChangeOwner() instead of thegeneric AlterObjectOwner_internal(), and ATExecChangeOwner() fulfillsthe locking mandate.Like in GRANT, implement this by following the locking protocol for anycatalog subject to the generic AlterObjectOwner_internal(). It wouldsuffice to do this for IsInplaceUpdateOid() catalogs only. Back-patchto v13 (all supported versions).Kirill Reshke. Reported by Alexander Kukushkin.Discussion:https://postgr.es/m/CAFh8B=mpKjAy4Cuun-HP-f_vRzh2HSvYFG3rhVfYbfEBUhBAGg@mail.gmail.com1 parentd8b0c64 commitfa61313
File tree
5 files changed
+51
-2
lines changed- src
- backend
- catalog
- commands
- include/catalog
- test/regress
- expected
- sql
5 files changed
+51
-2
lines changedLines changed: 26 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
2779 | 2779 |
| |
2780 | 2780 |
| |
2781 | 2781 |
| |
| 2782 | + | |
| 2783 | + | |
| 2784 | + | |
| 2785 | + | |
| 2786 | + | |
| 2787 | + | |
| 2788 | + | |
| 2789 | + | |
| 2790 | + | |
| 2791 | + | |
| 2792 | + | |
| 2793 | + | |
| 2794 | + | |
| 2795 | + | |
| 2796 | + | |
| 2797 | + | |
2782 | 2798 |
| |
2783 | 2799 |
| |
2784 | 2800 |
| |
2785 | 2801 |
| |
2786 | 2802 |
| |
2787 | 2803 |
| |
2788 | 2804 |
| |
2789 |
| - | |
| 2805 | + | |
| 2806 | + | |
| 2807 | + | |
| 2808 | + | |
| 2809 | + | |
| 2810 | + | |
2790 | 2811 |
| |
2791 | 2812 |
| |
2792 | 2813 |
| |
| |||
2811 | 2832 |
| |
2812 | 2833 |
| |
2813 | 2834 |
| |
| 2835 | + | |
| 2836 | + | |
| 2837 | + | |
| 2838 | + | |
2814 | 2839 |
| |
2815 | 2840 |
| |
2816 | 2841 |
| |
|
Lines changed: 8 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
59 | 59 |
| |
60 | 60 |
| |
61 | 61 |
| |
| 62 | + | |
62 | 63 |
| |
63 | 64 |
| |
64 | 65 |
| |
| |||
931 | 932 |
| |
932 | 933 |
| |
933 | 934 |
| |
934 |
| - | |
| 935 | + | |
| 936 | + | |
| 937 | + | |
935 | 938 |
| |
936 | 939 |
| |
937 | 940 |
| |
| |||
1031 | 1034 |
| |
1032 | 1035 |
| |
1033 | 1036 |
| |
| 1037 | + | |
| 1038 | + | |
1034 | 1039 |
| |
1035 | 1040 |
| |
1036 | 1041 |
| |
| |||
1039 | 1044 |
| |
1040 | 1045 |
| |
1041 | 1046 |
| |
| 1047 | + | |
| 1048 | + | |
1042 | 1049 |
| |
1043 | 1050 |
| |
1044 | 1051 |
| |
|
Lines changed: 4 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
69 | 69 |
| |
70 | 70 |
| |
71 | 71 |
| |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
72 | 76 |
| |
73 | 77 |
| |
74 | 78 |
| |
|
Lines changed: 6 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
12 | 12 |
| |
13 | 13 |
| |
14 | 14 |
| |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
15 | 19 |
| |
| 20 | + | |
| 21 | + |
Lines changed: 7 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
14 | 14 |
| |
15 | 15 |
| |
16 | 16 |
| |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
17 | 22 |
| |
| 23 | + | |
| 24 | + |
0 commit comments
Comments
(0)