It seems that the not null constraint is applied
before the default constraint if a column is
defined with both default and not null.
I understand that default should make the
the NOT NULL constraint unnecessary. But still....
Is this the intended behaviour?
create table nulldefault ( one integer NOT NULL default 1 );
CREATE TABLE
^
elein=# insert into nulldefault values (NULL);
ERROR: null value in column "one" violates not-null constraint
elein=# create table defaultnull (one integer default 1);
CREATE TABLE
elein=# insert into defaultnull values (NULL);
INSERT 4681559 1
--elein
elein@varlena.com