- Notifications
You must be signed in to change notification settings - Fork28
Commit2d7d946
committed
Clean up the behavior and API of catalog.c's is-catalog-relation tests.
The right way for IsCatalogRelation/Class to behave is to return truefor OIDs less than FirstBootstrapObjectId (not FirstNormalObjectId),without any of the ad-hoc fooling around with schema membership.The previous code was wrong because (1) it claimed thatinformation_schema tables were not catalog relations but their toasttables were, which is silly; and (2) if you dropped and recreatedinformation_schema, which is a supported operation, the behaviorchanged. That's even sillier. With this definition, "catalogrelations" are exactly the ones traceable to the postgres.bki data,which seems like what we want.With this simplification, we don't actually need access to the pg_classtuple to identify a catalog relation; we only need its OID. Hence,replace IsCatalogClass with "IsCatalogRelationOid(oid)". But keepIsCatalogRelation as a convenience function.This allows fixing some arguably-wrong semantics in contrib/sepgsql andReindexRelationConcurrently, which were using an IsSystemNamespace testwhere what they really should be using is IsCatalogRelationOid. Theprevious coding failed to protect toast tables of system catalogs, andalso was not on board with the general principle that user-created tablesdo not become catalogs just by virtue of being renamed into pg_catalog.We can also get rid of a messy hack in ReindexMultipleTables.While we're at it, also rename IsSystemNamespace to IsCatalogNamespace,because the previous name invited confusion with the more expansivesemantics used by IsSystemRelation/Class.Also improve the comments in catalog.c.There are a few remaining places in replication-related code that arespecial-casing OIDs below FirstNormalObjectId. I'm inclined to thinkthose are wrong too, and if there should be any special case it shouldjust extend to FirstBootstrapObjectId. But first we need to debatewhether a FOR ALL TABLES publication should include information_schema.Discussion:https://postgr.es/m/21697.1557092753@sss.pgh.pa.usDiscussion:https://postgr.es/m/15150.1557257111@sss.pgh.pa.us1 parent3ae3c18 commit2d7d946
File tree
9 files changed
+81
-67
lines changed- contrib/sepgsql
- src
- backend
- access/transam
- catalog
- commands
- utils/cache
- include/catalog
9 files changed
+81
-67
lines changedLines changed: 3 additions & 5 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
161 | 161 |
| |
162 | 162 |
| |
163 | 163 |
| |
164 |
| - | |
165 |
| - | |
166 |
| - | |
167 |
| - | |
| 164 | + | |
168 | 165 |
| |
169 |
| - | |
| 166 | + | |
| 167 | + | |
170 | 168 |
| |
171 | 169 |
| |
172 | 170 |
| |
|
Lines changed: 1 addition & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
520 | 520 |
| |
521 | 521 |
| |
522 | 522 |
| |
523 |
| - | |
| 523 | + | |
524 | 524 |
| |
525 | 525 |
| |
526 | 526 |
| |
|
Lines changed: 59 additions & 43 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
53 | 53 |
| |
54 | 54 |
| |
55 | 55 |
| |
56 |
| - | |
57 |
| - | |
58 |
| - | |
59 |
| - | |
| 56 | + | |
| 57 | + | |
60 | 58 |
| |
61 |
| - | |
62 |
| - | |
63 |
| - | |
64 |
| - | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
65 | 68 |
| |
66 | 69 |
| |
67 | 70 |
| |
| |||
78 | 81 |
| |
79 | 82 |
| |
80 | 83 |
| |
81 |
| - | |
| 84 | + | |
| 85 | + | |
82 | 86 |
| |
83 | 87 |
| |
84 | 88 |
| |
85 | 89 |
| |
86 |
| - | |
87 |
| - | |
88 |
| - | |
89 |
| - | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
90 | 95 |
| |
91 |
| - | |
92 |
| - | |
93 |
| - | |
| 96 | + | |
| 97 | + | |
94 | 98 |
| |
95 | 99 |
| |
96 | 100 |
| |
97 | 101 |
| |
98 |
| - | |
| 102 | + | |
99 | 103 |
| |
100 | 104 |
| |
101 | 105 |
| |
102 |
| - | |
103 |
| - | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
104 | 112 |
| |
105 |
| - | |
| 113 | + | |
| 114 | + | |
106 | 115 |
| |
107 | 116 |
| |
108 |
| - | |
| 117 | + | |
109 | 118 |
| |
110 |
| - | |
111 |
| - | |
112 | 119 |
| |
113 |
| - | |
114 |
| - | |
115 |
| - | |
116 |
| - | |
117 |
| - | |
118 |
| - | |
119 |
| - | |
120 |
| - | |
121 |
| - | |
122 |
| - | |
123 |
| - | |
124 |
| - | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
125 | 123 |
| |
126 |
| - | |
127 |
| - | |
128 |
| - | |
129 |
| - | |
130 |
| - | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
131 | 131 |
| |
132 |
| - | |
| 132 | + | |
133 | 133 |
| |
134 | 134 |
| |
135 | 135 |
| |
136 | 136 |
| |
137 | 137 |
| |
| 138 | + | |
| 139 | + | |
138 | 140 |
| |
139 | 141 |
| |
140 | 142 |
| |
141 | 143 |
| |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
142 | 152 |
| |
143 | 153 |
| |
144 | 154 |
| |
| |||
157 | 167 |
| |
158 | 168 |
| |
159 | 169 |
| |
160 |
| - | |
| 170 | + | |
161 | 171 |
| |
162 | 172 |
| |
| 173 | + | |
| 174 | + | |
163 | 175 |
| |
164 | 176 |
| |
165 | 177 |
| |
166 | 178 |
| |
167 |
| - | |
| 179 | + | |
168 | 180 |
| |
169 | 181 |
| |
170 | 182 |
| |
| |||
173 | 185 |
| |
174 | 186 |
| |
175 | 187 |
| |
| 188 | + | |
| 189 | + | |
176 | 190 |
| |
177 | 191 |
| |
178 | 192 |
| |
| 193 | + | |
| 194 | + | |
179 | 195 |
| |
180 | 196 |
| |
181 | 197 |
| |
|
Lines changed: 1 addition & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
324 | 324 |
| |
325 | 325 |
| |
326 | 326 |
| |
327 |
| - | |
| 327 | + | |
328 | 328 |
| |
329 | 329 |
| |
330 | 330 |
| |
|
Lines changed: 5 additions & 3 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
93 | 93 |
| |
94 | 94 |
| |
95 | 95 |
| |
96 |
| - | |
97 |
| - | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
98 | 100 |
| |
99 | 101 |
| |
100 | 102 |
| |
101 | 103 |
| |
102 | 104 |
| |
103 |
| - | |
| 105 | + | |
104 | 106 |
| |
105 | 107 |
| |
106 | 108 |
| |
|
Lines changed: 4 additions & 8 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
2590 | 2590 |
| |
2591 | 2591 |
| |
2592 | 2592 |
| |
2593 |
| - | |
2594 |
| - | |
2595 |
| - | |
2596 |
| - | |
2597 |
| - | |
2598 |
| - | |
| 2593 | + | |
| 2594 | + | |
2599 | 2595 |
| |
2600 | 2596 |
| |
2601 |
| - | |
| 2597 | + | |
2602 | 2598 |
| |
2603 | 2599 |
| |
2604 | 2600 |
| |
| |||
2842 | 2838 |
| |
2843 | 2839 |
| |
2844 | 2840 |
| |
2845 |
| - | |
| 2841 | + | |
2846 | 2842 |
| |
2847 | 2843 |
| |
2848 | 2844 |
| |
|
Lines changed: 3 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
12453 | 12453 |
| |
12454 | 12454 |
| |
12455 | 12455 |
| |
12456 |
| - | |
| 12456 | + | |
| 12457 | + | |
12457 | 12458 |
| |
12458 |
| - | |
| 12459 | + | |
12459 | 12460 |
| |
12460 | 12461 |
| |
12461 | 12462 |
| |
|
Lines changed: 2 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
3316 | 3316 |
| |
3317 | 3317 |
| |
3318 | 3318 |
| |
3319 |
| - | |
3320 |
| - | |
| 3319 | + | |
| 3320 | + | |
3321 | 3321 |
| |
3322 | 3322 |
| |
3323 | 3323 |
| |
|
Lines changed: 3 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
24 | 24 |
| |
25 | 25 |
| |
26 | 26 |
| |
27 |
| - | |
28 | 27 |
| |
29 |
| - | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
30 | 31 |
| |
31 | 32 |
| |
32 | 33 |
| |
|
0 commit comments
Comments
(0)