forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit31b7b4d
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 parent64ebb43 commit31b7b4d
File tree
3 files changed
+38
-0
lines changed- src
- backend/catalog
- test/regress
- expected
- sql
3 files changed
+38
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2046 | 2046 | | |
2047 | 2047 | | |
2048 | 2048 | | |
| 2049 | + | |
2049 | 2050 | | |
2050 | 2051 | | |
2051 | 2052 | | |
| |||
2059 | 2060 | | |
2060 | 2061 | | |
2061 | 2062 | | |
| 2063 | + | |
2062 | 2064 | | |
2063 | 2065 | | |
2064 | 2066 | | |
| |||
2071 | 2073 | | |
2072 | 2074 | | |
2073 | 2075 | | |
| 2076 | + | |
| 2077 | + | |
| 2078 | + | |
| 2079 | + | |
| 2080 | + | |
| 2081 | + | |
| 2082 | + | |
| 2083 | + | |
| 2084 | + | |
2074 | 2085 | | |
2075 | 2086 | | |
2076 | 2087 | | |
| |||
| 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)