forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commite2d53c8
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 parent5521d81 commite2d53c8
File tree
3 files changed
+38
-0
lines changed- src
- backend/catalog
- test/regress
- expected
- sql
3 files changed
+38
-0
lines changedLines changed: 11 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
2025 | 2025 |
| |
2026 | 2026 |
| |
2027 | 2027 |
| |
| 2028 | + | |
2028 | 2029 |
| |
2029 | 2030 |
| |
2030 | 2031 |
| |
| |||
2038 | 2039 |
| |
2039 | 2040 |
| |
2040 | 2041 |
| |
| 2042 | + | |
2041 | 2043 |
| |
2042 | 2044 |
| |
2043 | 2045 |
| |
| |||
2050 | 2052 |
| |
2051 | 2053 |
| |
2052 | 2054 |
| |
| 2055 | + | |
| 2056 | + | |
| 2057 | + | |
| 2058 | + | |
| 2059 | + | |
| 2060 | + | |
| 2061 | + | |
| 2062 | + | |
| 2063 | + | |
2053 | 2064 |
| |
2054 | 2065 |
| |
2055 | 2066 |
| |
|
Lines changed: 14 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
204 | 204 |
| |
205 | 205 |
| |
206 | 206 |
| |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
207 | 221 |
| |
208 | 222 |
| |
209 | 223 |
| |
|
Lines changed: 13 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
105 | 105 |
| |
106 | 106 |
| |
107 | 107 |
| |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
108 | 121 |
| |
109 | 122 |
| |
110 | 123 |
| |
|
0 commit comments
Comments
(0)