Commit d645273
committed
Rethink function argument sorting in pg_dump.
Commit 7b583b2 created an unnecessary
dump failure hazard by applying pg_get_function_identity_arguments()
to every function in the database, even those that won't get dumped.
This could result in snapshot-related problems if concurrent sessions are,
for example, creating and dropping temporary functions, as noted by Marko
Tiikkaja in bug #12832. While this is by no means pg_dump's only such
issue with concurrent DDL, it's unfortunate that we added a new failure
mode for cases that used to work, and even more so that the failure was
created for basically cosmetic reasons (ie, to sort overloaded functions
more deterministically).
To fix, revert that patch and instead sort function arguments using
information that pg_dump has available anyway, namely the names of the
argument types. This will produce a slightly different sort ordering for
overloaded functions than the previous coding; but applying strcmp
directly to the output of pg_get_function_identity_arguments really was
a bit odd anyway. The sorting will still be name-based and hence
independent of possibly-installation-specific OID assignments. A small
additional benefit is that sorting now works regardless of server version.
Back-patch to 9.3, where the previous commit appeared.1 parent 49bb343 commit d645273
3 files changed
+22
-49
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3912 | 3912 | | |
3913 | 3913 | | |
3914 | 3914 | | |
3915 | | - | |
3916 | 3915 | | |
3917 | 3916 | | |
3918 | 3917 | | |
| |||
3922 | 3921 | | |
3923 | 3922 | | |
3924 | 3923 | | |
3925 | | - | |
| 3924 | + | |
3926 | 3925 | | |
3927 | 3926 | | |
3928 | 3927 | | |
3929 | 3928 | | |
3930 | | - | |
3931 | 3929 | | |
3932 | 3930 | | |
3933 | 3931 | | |
| |||
3945 | 3943 | | |
3946 | 3944 | | |
3947 | 3945 | | |
3948 | | - | |
3949 | | - | |
3950 | | - | |
3951 | | - | |
3952 | | - | |
3953 | | - | |
3954 | | - | |
3955 | | - | |
3956 | | - | |
3957 | | - | |
3958 | | - | |
3959 | | - | |
3960 | | - | |
3961 | | - | |
3962 | | - | |
3963 | 3946 | | |
3964 | 3947 | | |
3965 | 3948 | | |
3966 | 3949 | | |
3967 | 3950 | | |
3968 | 3951 | | |
3969 | | - | |
3970 | 3952 | | |
3971 | 3953 | | |
3972 | 3954 | | |
| |||
3981 | 3963 | | |
3982 | 3964 | | |
3983 | 3965 | | |
3984 | | - | |
3985 | 3966 | | |
3986 | 3967 | | |
3987 | 3968 | | |
| |||
3997 | 3978 | | |
3998 | 3979 | | |
3999 | 3980 | | |
4000 | | - | |
4001 | 3981 | | |
4002 | 3982 | | |
4003 | 3983 | | |
| |||
4021 | 4001 | | |
4022 | 4002 | | |
4023 | 4003 | | |
4024 | | - | |
4025 | 4004 | | |
4026 | 4005 | | |
4027 | 4006 | | |
| |||
4041 | 4020 | | |
4042 | 4021 | | |
4043 | 4022 | | |
4044 | | - | |
4045 | 4023 | | |
4046 | 4024 | | |
4047 | 4025 | | |
| |||
4093 | 4071 | | |
4094 | 4072 | | |
4095 | 4073 | | |
4096 | | - | |
4097 | 4074 | | |
4098 | 4075 | | |
4099 | 4076 | | |
| |||
4114 | 4091 | | |
4115 | 4092 | | |
4116 | 4093 | | |
4117 | | - | |
| 4094 | + | |
4118 | 4095 | | |
4119 | 4096 | | |
4120 | 4097 | | |
4121 | 4098 | | |
4122 | 4099 | | |
4123 | | - | |
4124 | 4100 | | |
4125 | 4101 | | |
4126 | 4102 | | |
| |||
4142 | 4118 | | |
4143 | 4119 | | |
4144 | 4120 | | |
4145 | | - | |
4146 | | - | |
4147 | | - | |
4148 | | - | |
4149 | | - | |
4150 | | - | |
4151 | | - | |
4152 | | - | |
4153 | | - | |
4154 | | - | |
4155 | | - | |
4156 | | - | |
4157 | | - | |
4158 | | - | |
4159 | | - | |
4160 | 4121 | | |
4161 | 4122 | | |
4162 | 4123 | | |
4163 | 4124 | | |
4164 | 4125 | | |
4165 | 4126 | | |
4166 | 4127 | | |
4167 | | - | |
4168 | 4128 | | |
4169 | 4129 | | |
4170 | 4130 | | |
| |||
4181 | 4141 | | |
4182 | 4142 | | |
4183 | 4143 | | |
4184 | | - | |
4185 | 4144 | | |
4186 | 4145 | | |
4187 | 4146 | | |
| |||
4207 | 4166 | | |
4208 | 4167 | | |
4209 | 4168 | | |
4210 | | - | |
4211 | 4169 | | |
4212 | 4170 | | |
4213 | 4171 | | |
| |||
4223 | 4181 | | |
4224 | 4182 | | |
4225 | 4183 | | |
4226 | | - | |
4227 | 4184 | | |
4228 | 4185 | | |
4229 | 4186 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
184 | 184 | | |
185 | 185 | | |
186 | 186 | | |
187 | | - | |
188 | 187 | | |
189 | 188 | | |
190 | 189 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
287 | 287 | | |
288 | 288 | | |
289 | 289 | | |
| 290 | + | |
290 | 291 | | |
291 | 292 | | |
292 | 293 | | |
293 | 294 | | |
294 | | - | |
295 | | - | |
296 | | - | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
297 | 314 | | |
298 | 315 | | |
299 | 316 | | |
| |||
0 commit comments