forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit8e396a7
committed
pg_dump: label PUBLICATION TABLE ArchiveEntries with an owner.
This is the same fix as commit9eabfe3 applied to INDEX ATTACHentries, but for table-to-publication attachments. As in thatcase, even though the backend doesn't record "ownership" of theattachment, we still ought to label it in the dump archive withthe role name that should run the ALTER PUBLICATION command.The existing behavior causes the ALTER to be done by the originalrole that started the restore; that will usually work fine, butthere may be corner cases where it fails.The bulk of the patch is concerned with changing structPublicationRelInfo to include a pointer to the associatedPublicationInfo object, so that we can get the owner's nameout of that when the time comes. While at it, I rewrotegetPublicationTables() to do just one query of pg_publication_rel,not one per table.Back-patch to v10 where this code was introduced.Discussion:https://postgr.es/m/1165710.1610473242@sss.pgh.pa.us1 parentebfe2db commit8e396a7
3 files changed
+85
-62
lines changedLines changed: 17 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
52 | 52 |
| |
53 | 53 |
| |
54 | 54 |
| |
| 55 | + | |
55 | 56 |
| |
56 | 57 |
| |
57 | 58 |
| |
58 | 59 |
| |
59 | 60 |
| |
60 | 61 |
| |
61 | 62 |
| |
| 63 | + | |
62 | 64 |
| |
63 | 65 |
| |
64 | 66 |
| |
| |||
93 | 95 |
| |
94 | 96 |
| |
95 | 97 |
| |
| 98 | + | |
96 | 99 |
| |
97 | 100 |
| |
98 | 101 |
| |
| |||
247 | 250 |
| |
248 | 251 |
| |
249 | 252 |
| |
250 |
| - | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
251 | 256 |
| |
252 | 257 |
| |
253 | 258 |
| |
| |||
937 | 942 |
| |
938 | 943 |
| |
939 | 944 |
| |
| 945 | + | |
| 946 | + | |
| 947 | + | |
| 948 | + | |
| 949 | + | |
| 950 | + | |
| 951 | + | |
| 952 | + | |
| 953 | + | |
| 954 | + | |
| 955 | + | |
940 | 956 |
| |
941 | 957 |
| |
942 | 958 |
| |
|
Lines changed: 64 additions & 59 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
3865 | 3865 |
| |
3866 | 3866 |
| |
3867 | 3867 |
| |
3868 |
| - | |
3869 |
| - | |
| 3868 | + | |
| 3869 | + | |
3870 | 3870 |
| |
3871 | 3871 |
| |
3872 | 3872 |
| |
| |||
3886 | 3886 |
| |
3887 | 3887 |
| |
3888 | 3888 |
| |
3889 |
| - | |
| 3889 | + | |
| 3890 | + | |
| 3891 | + | |
| 3892 | + | |
3890 | 3893 |
| |
3891 | 3894 |
| |
3892 | 3895 |
| |
| |||
3964 | 3967 |
| |
3965 | 3968 |
| |
3966 | 3969 |
| |
| 3970 | + | |
| 3971 | + | |
| 3972 | + | |
3967 | 3973 |
| |
3968 | 3974 |
| |
3969 | 3975 |
| |
| |||
4072 | 4078 |
| |
4073 | 4079 |
| |
4074 | 4080 |
| |
4075 |
| - | |
| 4081 | + | |
| 4082 | + | |
4076 | 4083 |
| |
4077 | 4084 |
| |
4078 | 4085 |
| |
| |||
4082 | 4089 |
| |
4083 | 4090 |
| |
4084 | 4091 |
| |
4085 |
| - | |
| 4092 | + | |
| 4093 | + | |
| 4094 | + | |
| 4095 | + | |
| 4096 | + | |
| 4097 | + | |
| 4098 | + | |
| 4099 | + | |
| 4100 | + | |
| 4101 | + | |
| 4102 | + | |
| 4103 | + | |
| 4104 | + | |
| 4105 | + | |
| 4106 | + | |
| 4107 | + | |
| 4108 | + | |
| 4109 | + | |
4086 | 4110 |
| |
4087 |
| - | |
| 4111 | + | |
| 4112 | + | |
| 4113 | + | |
| 4114 | + | |
4088 | 4115 |
| |
4089 | 4116 |
| |
4090 |
| - | |
| 4117 | + | |
| 4118 | + | |
4091 | 4119 |
| |
4092 |
| - | |
4093 |
| - | |
| 4120 | + | |
| 4121 | + | |
| 4122 | + | |
| 4123 | + | |
| 4124 | + | |
4094 | 4125 |
| |
4095 | 4126 |
| |
4096 | 4127 |
| |
| |||
4100 | 4131 |
| |
4101 | 4132 |
| |
4102 | 4133 |
| |
4103 |
| - | |
4104 |
| - | |
4105 |
| - | |
4106 |
| - | |
4107 |
| - | |
4108 |
| - | |
4109 |
| - | |
4110 |
| - | |
4111 |
| - | |
4112 |
| - | |
4113 |
| - | |
4114 |
| - | |
4115 |
| - | |
4116 |
| - | |
4117 |
| - | |
4118 |
| - | |
4119 |
| - | |
4120 |
| - | |
4121 |
| - | |
4122 |
| - | |
4123 |
| - | |
4124 |
| - | |
4125 |
| - | |
4126 |
| - | |
4127 |
| - | |
4128 |
| - | |
4129 |
| - | |
4130 |
| - | |
4131 |
| - | |
| 4134 | + | |
| 4135 | + | |
| 4136 | + | |
| 4137 | + | |
| 4138 | + | |
| 4139 | + | |
| 4140 | + | |
| 4141 | + | |
| 4142 | + | |
| 4143 | + | |
4132 | 4144 |
| |
4133 |
| - | |
| 4145 | + | |
| 4146 | + | |
4134 | 4147 |
| |
4135 |
| - | |
4136 |
| - | |
4137 |
| - | |
4138 |
| - | |
4139 |
| - | |
4140 |
| - | |
4141 |
| - | |
4142 |
| - | |
4143 |
| - | |
4144 |
| - | |
4145 |
| - | |
4146 |
| - | |
4147 |
| - | |
4148 |
| - | |
4149 |
| - | |
4150 |
| - | |
| 4148 | + | |
4151 | 4149 |
| |
| 4150 | + | |
| 4151 | + | |
4152 | 4152 |
| |
4153 | 4153 |
| |
4154 | 4154 |
| |
| |||
4159 | 4159 |
| |
4160 | 4160 |
| |
4161 | 4161 |
| |
| 4162 | + | |
4162 | 4163 |
| |
4163 | 4164 |
| |
4164 | 4165 |
| |
4165 | 4166 |
| |
4166 | 4167 |
| |
4167 | 4168 |
| |
4168 | 4169 |
| |
4169 |
| - | |
| 4170 | + | |
4170 | 4171 |
| |
4171 | 4172 |
| |
4172 | 4173 |
| |
4173 | 4174 |
| |
4174 |
| - | |
| 4175 | + | |
4175 | 4176 |
| |
4176 | 4177 |
| |
4177 | 4178 |
| |
4178 | 4179 |
| |
4179 |
| - | |
4180 |
| - | |
| 4180 | + | |
| 4181 | + | |
| 4182 | + | |
| 4183 | + | |
| 4184 | + | |
4181 | 4185 |
| |
4182 | 4186 |
| |
4183 | 4187 |
| |
4184 | 4188 |
| |
| 4189 | + | |
4185 | 4190 |
| |
4186 | 4191 |
| |
4187 | 4192 |
| |
|
Lines changed: 4 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
623 | 623 |
| |
624 | 624 |
| |
625 | 625 |
| |
| 626 | + | |
626 | 627 |
| |
627 |
| - | |
628 | 628 |
| |
629 | 629 |
| |
630 | 630 |
| |
| |||
675 | 675 |
| |
676 | 676 |
| |
677 | 677 |
| |
| 678 | + | |
678 | 679 |
| |
679 | 680 |
| |
680 | 681 |
| |
| |||
727 | 728 |
| |
728 | 729 |
| |
729 | 730 |
| |
730 |
| - | |
| 731 | + | |
| 732 | + | |
731 | 733 |
| |
732 | 734 |
| |
733 | 735 |
| |
|
0 commit comments
Comments
(0)