forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commitc30f177
committed
Apply ALTER ... SET NOT NULL recursively in ALTER ... ADD PRIMARY KEY.
If you do ALTER COLUMN SET NOT NULL against an inheritance parent table,it will recurse to mark all the child columns as NOT NULL as well. Thisis necessary for consistency: if the column is labeled NOT NULL thenreading it should never produce nulls.However, that didn't happen in the case where ALTER ... ADD PRIMARY KEYmarks a target column NOT NULL that wasn't before. That was questionablefrom the beginning, and now Tushar Ahuja points out that it can lead todump/restore failures in some cases. So let's make that case recurse too.Although this is meant to fix a bug, it's enough of a behavioral changethat I'm pretty hesitant to back-patch, especially in view of the lackof similar field complaints. It doesn't seem to be too late to put itinto v10 though.Michael Paquier, editorialized on slightly by meDiscussion:https://postgr.es/m/b8794d6a-38f0-9d7c-ad4b-e85adf860fc9@enterprisedb.com1 parent97d3a0b commitc30f177
File tree
2 files changed
+5
-6
lines changed- src
- backend/catalog
- test/regress/expected
2 files changed
+5
-6
lines changedLines changed: 4 additions & 5 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
185 | 185 |
| |
186 | 186 |
| |
187 | 187 |
| |
| 188 | + | |
| 189 | + | |
| 190 | + | |
188 | 191 |
| |
189 | 192 |
| |
190 | 193 |
| |
| |||
253 | 256 |
| |
254 | 257 |
| |
255 | 258 |
| |
256 |
| - | |
257 |
| - | |
258 |
| - | |
259 |
| - | |
260 | 259 |
| |
261 | 260 |
| |
262 | 261 |
| |
263 | 262 |
| |
264 | 263 |
| |
265 | 264 |
| |
266 |
| - | |
| 265 | + | |
267 | 266 |
| |
268 | 267 |
| |
269 | 268 |
| |
|
Lines changed: 1 addition & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
328 | 328 |
| |
329 | 329 |
| |
330 | 330 |
| |
331 |
| - | |
| 331 | + | |
332 | 332 |
| |
333 | 333 |
| |
334 | 334 |
| |
|
0 commit comments
Comments
(0)