Re: [HACKERS] 7.1 (current) unwanted NOT NULL constraint inserted

2000-12-15 Thread Oliver Elphick
Tom Lane wrote: ... >Short of a major restructuring of inherited-column creation, I see >no good solution to this. I see two bad solutions: > >1. Require that the referenced column be marked NOT NULL already, >so that the constraint will be inherited properly from the parent. >In othe

Re: [HACKERS] 7.1 (current) unwanted NOT NULL constraint inserted

2000-12-15 Thread Tom Lane
OK, I see the problem. You have: CREATE TABLE person ( id CHAR(10) ); CREATE TABLE organisation ( ..., PRIMARY KEY (id) ) INHERITS (person); ie, a PRIMARY KEY declaration on an inherited column. Normally a PRIMARY KEY declaration causes the key column to become marked NOT N

Re: [HACKERS] 7.1 (current) unwanted NOT NULL constraint inserted

2000-12-15 Thread Tom Lane
I can't reproduce this --- I get Constraints: ((ptype >= 0) AND (ptype <= 8)) structure = 'L'::bpchar) OR (structure = 'C'::bpchar)) OR (structure = 'U'::bpchar)) OR (structure = 'O'::bpchar)) (((department ISNULL) AND (parent_id ISNULL)) OR ((department > ''::text)

[HACKERS] 7.1 (current) unwanted NOT NULL constraint inserted (more)

2000-12-15 Thread Oliver Elphick
"Oliver Elphick" wrote: >In the creation below, the column parent_id has ended up with a NOT NULL >constraint that I didn't ask for and don't want. If I change the order of the columns, the NOT NULL constraint always ends up on the last column. This is not the only table to be affected. Ev

[HACKERS] 7.1 (current) unwanted NOT NULL constraint inserted

2000-12-15 Thread Oliver Elphick
In the creation below, the column parent_id has ended up with a NOT NULL constraint that I didn't ask for and don't want. This is 7.1, updated today from cvs. === [... other tables created ...] CREATE TABLE person ( ptype