forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commitfd41ba9
committed
Dump not-null constraints on inherited columns correctly
With not-null constraints defined in child tables for columns that arecoming from their parent tables, we were printing ALTER TABLE SET NOTNULL commands that were missing the constraint name, so the originalconstraint name was being lost, which is bogus. Fix by instead addinga table-constraint constraint declaration with the correct constraintname in the CREATE TABLE instead.Oversight in commit14e87ff.We could have fixed it by changing the ALTER TABLE SET NOT NULL to ALTERTABLE ADD CONSTRAINT, but I'm not sure that's any better. A potentialproblem here might be that if sent to a non-Postgres server, the newpg_dump output would fail because the "CONSTRAINT foo NOT NULL colname"syntax isn't SQL-conforming. However, Postgres' implementation ofinheritance is already non-SQL-conforming, so that'd likely fail anyway.This problem was only noticed by Ashutosh's proposed test framework forpg_dump,https://postgr.es/m/CAExHW5uF5V=Cjecx3_Z=7xfh4rg2Wf61PT+hfquzjBqouRzQJQ@mail.gmail.comAuthor: Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>Reported-by: Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>Reviewed-by: Alvaro Herrera <alvherre@alvh.no-ip.org>Discussion:https://postgr.es/m/CAExHW5tbdgAKDfqjDJ-7Fk6PJtHg8D4zUF6FQ4H2Pq8zK38Nyw@mail.gmail.com1 parenta0ff56e commitfd41ba9
1 file changed
+32
-23
lines changedLines changed: 32 additions & 23 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
16220 | 16220 |
| |
16221 | 16221 |
| |
16222 | 16222 |
| |
| 16223 | + | |
| 16224 | + | |
| 16225 | + | |
| 16226 | + | |
| 16227 | + | |
| 16228 | + | |
| 16229 | + | |
| 16230 | + | |
| 16231 | + | |
| 16232 | + | |
| 16233 | + | |
| 16234 | + | |
| 16235 | + | |
| 16236 | + | |
| 16237 | + | |
| 16238 | + | |
| 16239 | + | |
| 16240 | + | |
| 16241 | + | |
| 16242 | + | |
| 16243 | + | |
| 16244 | + | |
| 16245 | + | |
| 16246 | + | |
| 16247 | + | |
| 16248 | + | |
| 16249 | + | |
| 16250 | + | |
| 16251 | + | |
| 16252 | + | |
| 16253 | + | |
| 16254 | + | |
16223 | 16255 |
| |
16224 | 16256 |
| |
16225 | 16257 |
| |
| |||
16661 | 16693 |
| |
16662 | 16694 |
| |
16663 | 16695 |
| |
16664 |
| - | |
16665 |
| - | |
16666 |
| - | |
16667 |
| - | |
16668 |
| - | |
16669 |
| - | |
16670 |
| - | |
16671 |
| - | |
16672 |
| - | |
16673 |
| - | |
16674 |
| - | |
16675 |
| - | |
16676 |
| - | |
16677 |
| - | |
16678 |
| - | |
16679 |
| - | |
16680 |
| - | |
16681 |
| - | |
16682 |
| - | |
16683 |
| - | |
16684 |
| - | |
16685 |
| - | |
16686 |
| - | |
16687 | 16696 |
| |
16688 | 16697 |
| |
16689 | 16698 |
| |
|
0 commit comments
Comments
(0)