forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commitfbef434
committed
Make CREATE OR REPLACE VIEW internally more consistent
The way that columns are added to a view is by callingAlterTableInternal with special subtype AT_AddColumnToView; but thatsubtype is changed to AT_AddColumnRecurse by ATPrepAddColumn. This hasno visible effect in the current code, since views cannot haveinheritance children (thus the recursion step is a no-op) and adding acolumn to a view is executed identically to doing it to a table; but itdoes make a difference for future event trigger code keeping track ofcommands, because the current situation leads to confusing the case witha normal ALTER TABLE ADD COLUMN.Fix the problem by passing a flag to ATPrepAddColumn to prevent it fromchanging the command subtype. The event trigger code can then properlyignore the subcommand. (We could remove the call to ATPrepAddColumn,since views are never typed, and there is never a need for recursion,which are the two conditions that are checked by ATPrepAddColumn; but itseems more future-proof to keep the call in place.)1 parentf65e827 commitfbef434
1 file changed
+8
-6
lines changedLines changed: 8 additions & 6 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
325 | 325 |
| |
326 | 326 |
| |
327 | 327 |
| |
328 |
| - | |
| 328 | + | |
329 | 329 |
| |
330 | 330 |
| |
331 | 331 |
| |
| |||
3085 | 3085 |
| |
3086 | 3086 |
| |
3087 | 3087 |
| |
3088 |
| - | |
| 3088 | + | |
| 3089 | + | |
3089 | 3090 |
| |
3090 | 3091 |
| |
3091 | 3092 |
| |
3092 | 3093 |
| |
3093 | 3094 |
| |
3094 | 3095 |
| |
3095 |
| - | |
| 3096 | + | |
| 3097 | + | |
3096 | 3098 |
| |
3097 | 3099 |
| |
3098 | 3100 |
| |
| |||
4576 | 4578 |
| |
4577 | 4579 |
| |
4578 | 4580 |
| |
4579 |
| - | |
| 4581 | + | |
4580 | 4582 |
| |
4581 | 4583 |
| |
4582 | 4584 |
| |
| |||
4586 | 4588 |
| |
4587 | 4589 |
| |
4588 | 4590 |
| |
4589 |
| - | |
| 4591 | + | |
4590 | 4592 |
| |
4591 | 4593 |
| |
4592 | 4594 |
| |
| |||
5026 | 5028 |
| |
5027 | 5029 |
| |
5028 | 5030 |
| |
5029 |
| - | |
| 5031 | + | |
5030 | 5032 |
| |
5031 | 5033 |
| |
5032 | 5034 |
| |
|
0 commit comments
Comments
(0)