forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit3839e29
committed
Flush table's relcache during ALTER TABLE ADD PRIMARY KEY USING INDEX.
Previously, unless we had to add a NOT NULL constraint to the column,this command resulted in updating only the index's relcache entry.That's problematic when replication behavior is being driven off theexistence of a primary key: other sessions (and ours too for thatmatter) failed to recalculate their opinion of whether the table canbe replicated. Add a relcache invalidation to fix it.This has been broken since pg_class.relhaspkey was removed in v11.Before that, updating the table's relhaspkey value sufficed to causea cache flush. Hence, backpatch to v11.Report and patch by Hou ZhijieDiscussion:https://postgr.es/m/OS0PR01MB5716EBE01F112C62F8F9B786947B9@OS0PR01MB5716.jpnprd01.prod.outlook.com1 parentf4ebf0d commit3839e29
File tree
3 files changed
+38
-0
lines changed- src
- backend/catalog
- test/regress
- expected
- sql
3 files changed
+38
-0
lines changedOriginal file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
2050 | 2050 |
| |
2051 | 2051 |
| |
2052 | 2052 |
| |
| 2053 | + | |
2053 | 2054 |
| |
2054 | 2055 |
| |
2055 | 2056 |
| |
| |||
2063 | 2064 |
| |
2064 | 2065 |
| |
2065 | 2066 |
| |
| 2067 | + | |
2066 | 2068 |
| |
2067 | 2069 |
| |
2068 | 2070 |
| |
| |||
2075 | 2077 |
| |
2076 | 2078 |
| |
2077 | 2079 |
| |
| 2080 | + | |
| 2081 | + | |
| 2082 | + | |
| 2083 | + | |
| 2084 | + | |
| 2085 | + | |
| 2086 | + | |
| 2087 | + | |
| 2088 | + | |
2078 | 2089 |
| |
2079 | 2090 |
| |
2080 | 2091 |
| |
|
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
268 | 268 |
| |
269 | 269 |
| |
270 | 270 |
| |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
271 | 285 |
| |
272 | 286 |
| |
273 | 287 |
| |
|
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
149 | 149 |
| |
150 | 150 |
| |
151 | 151 |
| |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
152 | 165 |
| |
153 | 166 |
| |
154 | 167 |
| |
|
0 commit comments
Comments
(0)