Commit f0d4394
committed
Block ALTER TABLE .. DROP NOT NULL on columns in replica identity index
Replica identities that depend directly on an index rely on a set of
properties, one of them being that all the columns defined in this index
have to be marked as NOT NULL. There was a hole in the logic with ALTER
TABLE DROP NOT NULL, where it was possible to remove the NOT NULL
property of a column part of an index used as replica identity, so block
it to avoid problems with logical decoding down the road.
The same check was already done columns part of a primary key, so the
fix is straight-forward.
Author: Haiying Tang, Hou Zhijie
Reviewed-by: Dilip Kumar, Michael Paquier
Discussion: https://postgr.es/m/OS0PR01MB6113338C102BEE8B2FFC5BD9FB619@OS0PR01MB6113.jpnprd01.prod.outlook.com
Backpatch-through: 101 parent 10260c7 commit f0d4394
File tree
3 files changed
+30
-9
lines changed- src
- backend/commands
- test/regress
- expected
- sql
3 files changed
+30
-9
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7144 | 7144 | | |
7145 | 7145 | | |
7146 | 7146 | | |
7147 | | - | |
| 7147 | + | |
| 7148 | + | |
7148 | 7149 | | |
7149 | 7150 | | |
7150 | 7151 | | |
| |||
7164 | 7165 | | |
7165 | 7166 | | |
7166 | 7167 | | |
7167 | | - | |
7168 | | - | |
| 7168 | + | |
| 7169 | + | |
| 7170 | + | |
| 7171 | + | |
| 7172 | + | |
7169 | 7173 | | |
7170 | 7174 | | |
7171 | | - | |
7172 | | - | |
| 7175 | + | |
| 7176 | + | |
| 7177 | + | |
7173 | 7178 | | |
7174 | 7179 | | |
7175 | 7180 | | |
7176 | 7181 | | |
7177 | | - | |
7178 | | - | |
7179 | | - | |
7180 | | - | |
| 7182 | + | |
| 7183 | + | |
| 7184 | + | |
| 7185 | + | |
| 7186 | + | |
| 7187 | + | |
| 7188 | + | |
| 7189 | + | |
| 7190 | + | |
| 7191 | + | |
| 7192 | + | |
| 7193 | + | |
7181 | 7194 | | |
7182 | 7195 | | |
7183 | 7196 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
223 | 223 | | |
224 | 224 | | |
225 | 225 | | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
226 | 230 | | |
227 | 231 | | |
228 | 232 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
94 | 94 | | |
95 | 95 | | |
96 | 96 | | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
97 | 101 | | |
98 | 102 | | |
99 | 103 | | |
| |||
0 commit comments