forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit2cb1272
committed
Rethink method for assigning OIDs to the template0 and postgres DBs.
Commitaa01051 assigned fixed OIDs to template0 and postgresin a very ad-hoc way. Notably, instead of teaching Catalog.pmabout these OIDs, the unused_oids script was just hacked tonot show them as unused. That's problematic since, for example,duplicate_oids wouldn't report any future conflict. Hence,invent a macro DECLARE_OID_DEFINING_MACRO() that can be used todefine an OID that is known to Catalog.pm and will participatein duplicate-detection as well as renumbering by renumber_oids.pl.(We don't anticipate renumbering these particular OIDs, but wemight as well build out all the Catalog.pm infrastructure whilewe're here.)Another issue is thataa01051 neglected to touch IsPinnedObject,with the result that it now claimed template0 and postgres arepinned. The right thing to do there seems to be to teach it thatno database is pinned, since in fact DROP DATABASE doesn't checkfor pinned-ness (and at least for these cases, that is anintentional choice). It's not clear whether this wrong answerhad any visible effect, but perhaps it could have resulted inerroneous management of dependency entries.In passing, rename the TemplateDbOid macro to Template1DbOidto reduce confusion (likely we should have done that way backwhen we invented template0, but we didn't), and rename theOID macros for template0 and postgres to have a similar style.There are no changes to postgres.bki here, so no need for acatversion bump.Discussion:https://postgr.es/m/2935358.1650479692@sss.pgh.pa.us1 parent586955d commit2cb1272
File tree
14 files changed
+75
-34
lines changed- doc/src/sgml
- src
- backend
- access/transam
- catalog
- utils/init
- bin
- initdb
- pg_dump
- include
- access
- catalog
14 files changed
+75
-34
lines changedLines changed: 4 additions & 3 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
180 | 180 |
| |
181 | 181 |
| |
182 | 182 |
| |
183 |
| - | |
| 183 | + | |
184 | 184 |
| |
185 |
| - | |
| 185 | + | |
| 186 | + | |
186 | 187 |
| |
187 | 188 |
| |
188 |
| - | |
| 189 | + | |
189 | 190 |
| |
190 | 191 |
| |
191 | 192 |
| |
|
Lines changed: 2 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
4540 | 4540 |
| |
4541 | 4541 |
| |
4542 | 4542 |
| |
4543 |
| - | |
| 4543 | + | |
4544 | 4544 |
| |
4545 |
| - | |
| 4545 | + | |
4546 | 4546 |
| |
4547 | 4547 |
| |
4548 | 4548 |
| |
|
Lines changed: 14 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
44 | 44 |
| |
45 | 45 |
| |
46 | 46 |
| |
| 47 | + | |
| 48 | + | |
47 | 49 |
| |
48 | 50 |
| |
49 | 51 |
| |
| |||
118 | 120 |
| |
119 | 121 |
| |
120 | 122 |
| |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
121 | 131 |
| |
122 | 132 |
| |
123 | 133 |
| |
| |||
572 | 582 |
| |
573 | 583 |
| |
574 | 584 |
| |
| 585 | + | |
| 586 | + | |
| 587 | + | |
| 588 | + | |
575 | 589 |
| |
576 | 590 |
| |
577 | 591 |
| |
|
Lines changed: 9 additions & 5 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
339 | 339 |
| |
340 | 340 |
| |
341 | 341 |
| |
342 |
| - | |
343 |
| - | |
344 |
| - | |
345 |
| - | |
346 |
| - | |
347 | 342 |
| |
348 | 343 |
| |
349 | 344 |
| |
350 | 345 |
| |
351 | 346 |
| |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
352 | 356 |
| |
353 | 357 |
| |
354 | 358 |
| |
|
Lines changed: 7 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
472 | 472 |
| |
473 | 473 |
| |
474 | 474 |
| |
475 |
| - | |
| 475 | + | |
476 | 476 |
| |
477 | 477 |
| |
478 | 478 |
| |
| |||
488 | 488 |
| |
489 | 489 |
| |
490 | 490 |
| |
| 491 | + | |
| 492 | + | |
| 493 | + | |
| 494 | + | |
| 495 | + | |
| 496 | + | |
491 | 497 |
| |
492 | 498 |
| |
493 | 499 |
| |
|
Lines changed: 1 addition & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
908 | 908 |
| |
909 | 909 |
| |
910 | 910 |
| |
911 |
| - | |
| 911 | + | |
912 | 912 |
| |
913 | 913 |
| |
914 | 914 |
| |
|
Lines changed: 5 additions & 4 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
59 | 59 |
| |
60 | 60 |
| |
61 | 61 |
| |
62 |
| - | |
63 | 62 |
| |
64 | 63 |
| |
65 | 64 |
| |
66 | 65 |
| |
| 66 | + | |
67 | 67 |
| |
68 | 68 |
| |
69 | 69 |
| |
| |||
1812 | 1812 |
| |
1813 | 1813 |
| |
1814 | 1814 |
| |
1815 |
| - | |
1816 |
| - | |
| 1815 | + | |
| 1816 | + | |
1817 | 1817 |
| |
1818 | 1818 |
| |
1819 | 1819 |
| |
| |||
1862 | 1862 |
| |
1863 | 1863 |
| |
1864 | 1864 |
| |
1865 |
| - | |
| 1865 | + | |
| 1866 | + | |
1866 | 1867 |
| |
1867 | 1868 |
| |
1868 | 1869 |
| |
|
Lines changed: 5 additions & 4 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
2901 | 2901 |
| |
2902 | 2902 |
| |
2903 | 2903 |
| |
2904 |
| - | |
2905 |
| - | |
2906 |
| - | |
2907 |
| - | |
| 2904 | + | |
| 2905 | + | |
| 2906 | + | |
| 2907 | + | |
| 2908 | + | |
2908 | 2909 |
| |
2909 | 2910 |
| |
2910 | 2911 |
| |
|
Lines changed: 0 additions & 4 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
196 | 196 |
| |
197 | 197 |
| |
198 | 198 |
| |
199 |
| - | |
200 |
| - | |
201 |
| - | |
202 |
| - | |
203 | 199 |
| |
204 | 200 |
| |
205 | 201 |
| |
|
Lines changed: 8 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
84 | 84 |
| |
85 | 85 |
| |
86 | 86 |
| |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
87 | 95 |
| |
88 | 96 |
| |
89 | 97 |
| |
|
Lines changed: 1 addition & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
12 | 12 |
| |
13 | 13 |
| |
14 | 14 |
| |
15 |
| - | |
| 15 | + | |
16 | 16 |
| |
17 | 17 |
| |
18 | 18 |
| |
|
Lines changed: 9 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
91 | 91 |
| |
92 | 92 |
| |
93 | 93 |
| |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
94 | 103 |
|
Lines changed: 10 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
170 | 170 |
| |
171 | 171 |
| |
172 | 172 |
| |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
173 | 183 |
| |
174 | 184 |
| |
175 | 185 |
| |
|
Lines changed: 0 additions & 9 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
32 | 32 |
| |
33 | 33 |
| |
34 | 34 |
| |
35 |
| - | |
36 |
| - | |
37 |
| - | |
38 |
| - | |
39 |
| - | |
40 |
| - | |
41 |
| - | |
42 |
| - | |
43 |
| - | |
44 | 35 |
| |
45 | 36 |
| |
46 | 37 |
| |
|
0 commit comments
Comments
(0)