forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit8468146
committed
Fix the inadvertent libpq ABI breakage discovered by Martin Pitt: the
renumbering of encoding IDs done between 8.2 and 8.3 turns out to break 8.2initdb and psql if they are run with an 8.3beta1 libpq.so. For the momentwe can rearrange the order of enum pg_enc to keep the same number foreverything except PG_JOHAB, which isn't a problem since there are no directreferences to it in the 8.2 programs anyway. (This does force initdbunfortunately.)Going forward, we want to fix things so that encoding IDs can be changedwithout an ABI break, and this commit includes the changes needed to allowlibpq's encoding IDs to be treated as fully independent of the backend's.The main issue is that libpq clients should not include pg_wchar.h orotherwise assume they know the specific values of libpq's encoding IDs,since they might encounter version skew between pg_wchar.h and the libpq.sothey are using. To fix, have libpq officially export functions needed forencoding name<=>ID conversion and validity checking; it was doing thisanyway unofficially.It's still the case that we can't renumber backend encoding IDs until thenext bump in libpq's major version number, since doing so will break the8.2-era client programs. However the code is now prepared to avoid thistype of problem in future.Note that initdb is no longer a libpq client: we just pull in the twosource files we need directly. The patch also fixes a few places thatwere being sloppy about checking for an unrecognized encoding name.1 parent537e92e commit8468146
File tree
21 files changed
+194
-81
lines changed- src
- backend
- commands
- utils
- adt
- mb
- bin
- initdb
- pg_dump
- psql
- scripts
- include
- catalog
- mb
- interfaces/libpq
21 files changed
+194
-81
lines changedLines changed: 3 additions & 3 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
13 | 13 |
| |
14 | 14 |
| |
15 | 15 |
| |
16 |
| - | |
| 16 | + | |
17 | 17 |
| |
18 | 18 |
| |
19 | 19 |
| |
| |||
178 | 178 |
| |
179 | 179 |
| |
180 | 180 |
| |
181 |
| - | |
| 181 | + | |
| 182 | + | |
182 | 183 |
| |
183 | 184 |
| |
184 | 185 |
| |
185 | 186 |
| |
186 |
| - | |
187 | 187 |
| |
188 | 188 |
| |
189 | 189 |
| |
|
Lines changed: 13 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
5 | 5 |
| |
6 | 6 |
| |
7 | 7 |
| |
8 |
| - | |
| 8 | + | |
9 | 9 |
| |
10 | 10 |
| |
11 | 11 |
| |
| |||
117 | 117 |
| |
118 | 118 |
| |
119 | 119 |
| |
120 |
| - | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
121 | 127 |
| |
122 | 128 |
| |
123 | 129 |
| |
| |||
132 | 138 |
| |
133 | 139 |
| |
134 | 140 |
| |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
135 | 146 |
| |
136 | 147 |
| |
137 | 148 |
| |
|
Lines changed: 25 additions & 5 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
7 | 7 |
| |
8 | 8 |
| |
9 | 9 |
| |
10 |
| - | |
| 10 | + | |
11 | 11 |
| |
12 | 12 |
| |
13 | 13 |
| |
| |||
127 | 127 |
| |
128 | 128 |
| |
129 | 129 |
| |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
130 | 148 |
| |
131 | 149 |
| |
132 | 150 |
| |
| |||
263 | 281 |
| |
264 | 282 |
| |
265 | 283 |
| |
266 |
| - | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
267 | 287 |
| |
268 | 288 |
| |
269 | 289 |
| |
| |||
1084 | 1104 |
| |
1085 | 1105 |
| |
1086 | 1106 |
| |
1087 |
| - | |
1088 |
| - | |
1089 |
| - | |
| 1107 | + | |
| 1108 | + | |
| 1109 | + | |
1090 | 1110 |
| |
1091 | 1111 |
| |
1092 | 1112 |
| |
|
Lines changed: 18 additions & 11 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
2 | 2 |
| |
3 | 3 |
| |
4 | 4 |
| |
5 |
| - | |
| 5 | + | |
6 | 6 |
| |
7 | 7 |
| |
8 | 8 |
| |
| |||
12 | 12 |
| |
13 | 13 |
| |
14 | 14 |
| |
| 15 | + | |
15 | 16 |
| |
16 | 17 |
| |
17 | 18 |
| |
18 |
| - | |
| 19 | + | |
19 | 20 |
| |
20 | 21 |
| |
21 | 22 |
| |
| |||
313 | 314 |
| |
314 | 315 |
| |
315 | 316 |
| |
| 317 | + | |
| 318 | + | |
| 319 | + | |
316 | 320 |
| |
317 | 321 |
| |
318 | 322 |
| |
| |||
397 | 401 |
| |
398 | 402 |
| |
399 | 403 |
| |
400 |
| - | |
401 |
| - | |
402 |
| - | |
403 | 404 |
| |
404 | 405 |
| |
405 | 406 |
| |
| |||
413 | 414 |
| |
414 | 415 |
| |
415 | 416 |
| |
416 |
| - | |
| 417 | + | |
417 | 418 |
| |
418 | 419 |
| |
419 |
| - | |
| 420 | + | |
420 | 421 |
| |
421 | 422 |
| |
422 | 423 |
| |
| |||
455 | 456 |
| |
456 | 457 |
| |
457 | 458 |
| |
| 459 | + | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
458 | 465 |
| |
459 | 466 |
| |
460 | 467 |
| |
| |||
533 | 540 |
| |
534 | 541 |
| |
535 | 542 |
| |
536 |
| - | |
| 543 | + | |
537 | 544 |
| |
538 |
| - | |
| 545 | + | |
539 | 546 |
| |
540 |
| - | |
| 547 | + | |
541 | 548 |
| |
542 | 549 |
| |
543 |
| - | |
| 550 | + | |
544 | 551 |
| |
545 | 552 |
| |
546 | 553 |
| |
|
Lines changed: 7 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
4 | 4 |
| |
5 | 5 |
| |
6 | 6 |
| |
7 |
| - | |
| 7 | + | |
8 | 8 |
| |
9 | 9 |
| |
10 | 10 |
| |
| |||
421 | 421 |
| |
422 | 422 |
| |
423 | 423 |
| |
| 424 | + | |
| 425 | + | |
| 426 | + | |
| 427 | + | |
| 428 | + | |
| 429 | + | |
424 | 430 |
| |
425 | 431 |
| |
426 | 432 |
| |
|
Lines changed: 17 additions & 7 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
5 | 5 |
| |
6 | 6 |
| |
7 | 7 |
| |
8 |
| - | |
| 8 | + | |
9 | 9 |
| |
10 | 10 |
| |
11 | 11 |
| |
| |||
14 | 14 |
| |
15 | 15 |
| |
16 | 16 |
| |
17 |
| - | |
| 17 | + | |
18 | 18 |
| |
19 |
| - | |
| 19 | + | |
20 | 20 |
| |
21 |
| - | |
| 21 | + | |
22 | 22 |
| |
23 |
| - | |
24 |
| - | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
25 | 35 |
| |
26 | 36 |
| |
27 | 37 |
| |
| |||
33 | 43 |
| |
34 | 44 |
| |
35 | 45 |
| |
36 |
| - | |
| 46 | + | |
37 | 47 |
| |
38 | 48 |
| |
39 | 49 |
| |
|
Lines changed: 3 additions & 3 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
42 | 42 |
| |
43 | 43 |
| |
44 | 44 |
| |
45 |
| - | |
| 45 | + | |
46 | 46 |
| |
47 | 47 |
| |
48 | 48 |
| |
| |||
2808 | 2808 |
| |
2809 | 2809 |
| |
2810 | 2810 |
| |
2811 |
| - | |
| 2811 | + | |
2812 | 2812 |
| |
2813 | 2813 |
| |
2814 | 2814 |
| |
| |||
2968 | 2968 |
| |
2969 | 2969 |
| |
2970 | 2970 |
| |
2971 |
| - | |
| 2971 | + | |
2972 | 2972 |
| |
2973 | 2973 |
| |
2974 | 2974 |
| |
|
Lines changed: 2 additions & 3 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
15 | 15 |
| |
16 | 16 |
| |
17 | 17 |
| |
18 |
| - | |
| 18 | + | |
19 | 19 |
| |
20 | 20 |
| |
21 | 21 |
| |
| |||
32 | 32 |
| |
33 | 33 |
| |
34 | 34 |
| |
35 |
| - | |
36 | 35 |
| |
37 | 36 |
| |
38 | 37 |
| |
| |||
1639 | 1638 |
| |
1640 | 1639 |
| |
1641 | 1640 |
| |
1642 |
| - | |
| 1641 | + | |
1643 | 1642 |
| |
1644 | 1643 |
| |
1645 | 1644 |
| |
|
Lines changed: 1 addition & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
12 | 12 |
| |
13 | 13 |
| |
14 | 14 |
| |
15 |
| - | |
| 15 | + | |
16 | 16 |
| |
17 | 17 |
| |
18 | 18 |
| |
| |||
47 | 47 |
| |
48 | 48 |
| |
49 | 49 |
| |
50 |
| - | |
51 | 50 |
| |
52 | 51 |
| |
53 | 52 |
| |
|
Lines changed: 1 addition & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
6 | 6 |
| |
7 | 7 |
| |
8 | 8 |
| |
9 |
| - | |
| 9 | + | |
10 | 10 |
| |
11 | 11 |
| |
12 | 12 |
| |
| |||
27 | 27 |
| |
28 | 28 |
| |
29 | 29 |
| |
30 |
| - | |
31 | 30 |
| |
32 | 31 |
| |
33 | 32 |
| |
|
Lines changed: 2 additions & 3 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
3 | 3 |
| |
4 | 4 |
| |
5 | 5 |
| |
6 |
| - | |
| 6 | + | |
7 | 7 |
| |
8 | 8 |
| |
9 | 9 |
| |
| |||
45 | 45 |
| |
46 | 46 |
| |
47 | 47 |
| |
48 |
| - | |
49 | 48 |
| |
50 | 49 |
| |
51 | 50 |
| |
| |||
295 | 294 |
| |
296 | 295 |
| |
297 | 296 |
| |
298 |
| - | |
| 297 | + | |
299 | 298 |
| |
300 | 299 |
| |
301 | 300 |
| |
|
0 commit comments
Comments
(0)