forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit44fe30f
committed
Add default_char_signedness field to ControlFileData.
The signedness of the 'char' type in C isimplementation-dependent. For instance, 'signed char' is used bydefault on x86 CPUs, while 'unsigned char' is used on aarchCPUs. Previously, we accidentally let C implementation signednessaffect persistent data. This led to inconsistent results whencomparing char data across different platforms.This commit introduces a new 'default_char_signedness' field inControlFileData to store the signedness of the 'char' type. While thischange does not encourage the use of 'char' without explicitlyspecifying its signedness, this field can be used as a hint to ensureconsistent behavior for pre-v18 data files that store data sorted bythe 'char' type on disk (e.g., GIN and GiST indexes), especially incross-platform replication scenarios.Newly created database clusters unconditionally set the default charsignedness to true. pg_upgrade (with an upcoming commit) changes thisflag for clusters if the source database cluster hassignedness=false. As a result, signedness=false setting will becomerare over time. If we had known about the problem during the lastdevelopment cycle that forced initdb (v8.3), we would have made allclusters signed or all clusters unsigned. Making pg_upgrade the onlysource of signedness=false will cause the population of databaseclusters to converge toward that retrospective ideal.Bump catalog version (for the catalog changes) and PG_CONTROL_VERSION(for the additions in ControlFileData).Reviewed-by: Noah Misch <noah@leadboat.com>Discussion:https://postgr.es/m/CB11ADBC-0C3F-4FE0-A678-666EE80CBB07%40amazon.com1 parent901a1cf commit44fe30f
File tree
8 files changed
+64
-7
lines changed- doc/src/sgml
- src
- backend
- access/transam
- utils/misc
- bin/pg_controldata
- include
- access
- catalog
8 files changed
+64
-7
lines changedLines changed: 5 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
27991 | 27991 |
| |
27992 | 27992 |
| |
27993 | 27993 |
| |
| 27994 | + | |
| 27995 | + | |
| 27996 | + | |
| 27997 | + | |
| 27998 | + | |
27994 | 27999 |
| |
27995 | 28000 |
| |
27996 | 28001 |
| |
|
Lines changed: 40 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
4284 | 4284 |
| |
4285 | 4285 |
| |
4286 | 4286 |
| |
| 4287 | + | |
| 4288 | + | |
| 4289 | + | |
| 4290 | + | |
| 4291 | + | |
| 4292 | + | |
| 4293 | + | |
| 4294 | + | |
| 4295 | + | |
| 4296 | + | |
| 4297 | + | |
| 4298 | + | |
| 4299 | + | |
| 4300 | + | |
| 4301 | + | |
| 4302 | + | |
| 4303 | + | |
| 4304 | + | |
| 4305 | + | |
| 4306 | + | |
| 4307 | + | |
| 4308 | + | |
| 4309 | + | |
| 4310 | + | |
| 4311 | + | |
| 4312 | + | |
| 4313 | + | |
4287 | 4314 |
| |
4288 | 4315 |
| |
4289 | 4316 |
| |
| |||
4612 | 4639 |
| |
4613 | 4640 |
| |
4614 | 4641 |
| |
| 4642 | + | |
| 4643 | + | |
| 4644 | + | |
| 4645 | + | |
| 4646 | + | |
| 4647 | + | |
| 4648 | + | |
| 4649 | + | |
| 4650 | + | |
| 4651 | + | |
| 4652 | + | |
| 4653 | + | |
| 4654 | + | |
4615 | 4655 |
| |
4616 | 4656 |
| |
4617 | 4657 |
| |
|
Lines changed: 5 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
203 | 203 |
| |
204 | 204 |
| |
205 | 205 |
| |
206 |
| - | |
207 |
| - | |
| 206 | + | |
| 207 | + | |
208 | 208 |
| |
209 | 209 |
| |
210 | 210 |
| |
| |||
254 | 254 |
| |
255 | 255 |
| |
256 | 256 |
| |
| 257 | + | |
| 258 | + | |
| 259 | + | |
257 | 260 |
| |
258 | 261 |
| |
259 | 262 |
| |
|
Lines changed: 2 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
336 | 336 |
| |
337 | 337 |
| |
338 | 338 |
| |
| 339 | + | |
| 340 | + | |
339 | 341 |
| |
340 | 342 |
| |
341 | 343 |
| |
|
Lines changed: 1 addition & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
231 | 231 |
| |
232 | 232 |
| |
233 | 233 |
| |
| 234 | + | |
234 | 235 |
| |
235 | 236 |
| |
236 | 237 |
| |
|
Lines changed: 1 addition & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
57 | 57 |
| |
58 | 58 |
| |
59 | 59 |
| |
60 |
| - | |
| 60 | + | |
61 | 61 |
| |
62 | 62 |
|
Lines changed: 7 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
22 | 22 |
| |
23 | 23 |
| |
24 | 24 |
| |
25 |
| - | |
| 25 | + | |
26 | 26 |
| |
27 | 27 |
| |
28 | 28 |
| |
| |||
221 | 221 |
| |
222 | 222 |
| |
223 | 223 |
| |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
224 | 230 |
| |
225 | 231 |
| |
226 | 232 |
| |
|
Lines changed: 3 additions & 3 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
12206 | 12206 |
| |
12207 | 12207 |
| |
12208 | 12208 |
| |
12209 |
| - | |
12210 |
| - | |
12211 |
| - | |
| 12209 | + | |
| 12210 | + | |
| 12211 | + | |
12212 | 12212 |
| |
12213 | 12213 |
| |
12214 | 12214 |
| |
|
0 commit comments
Comments
(0)