[HACKERS] questions about not-null constraints and inheritance

2009-04-02 Thread K. Srinath
Consider two tables foo(x int not null) and bar (x int). I fire the sql SQL1: alter table bar inherit foo; Above sql causes ERROR: column x in child table must be marked NOT NULL. This looks logically fine to me. So, I fire the sql SQL2: alter table bar alter column x set not null; Then I

Re: [HACKERS] questions about not-null constraints and inheritance

2009-04-02 Thread Tom Lane
K. Srinath k.srin...@gmail.com writes: Why is this so? Because we don't track inheritance state for attnotnull. There is no way you can make it work right with marginal hacking on the ATExec code, because there just isn't enough state. The correct fix is probably the one alluded to in another