Re: [GENERAL] null constraints and defaults

2005-06-29 Thread Alvaro Herrera
On Wed, Jun 29, 2005 at 01:46:46PM -0700, elein wrote: [reformatted] > On Wed, Jun 29, 2005 at 08:25:09PM +, Matt Miller wrote: > > On Wed, 2005-06-29 at 13:04 -0700, elein wrote: > > > default constraint > > > ... > > > elein=# insert into nulldefault values (NULL); > > > ERROR: null value

Re: [GENERAL] null constraints and defaults

2005-06-29 Thread Stephan Szabo
On Wed, 29 Jun 2005, elein wrote: > 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

Re: [GENERAL] null constraints and defaults

2005-06-29 Thread elein
Thanks. I understand that much. I want to know if this is the intended behaviour. --elein On Wed, Jun 29, 2005 at 08:25:09PM +, Matt Miller wrote: > On Wed, 2005-06-29 at 13:04 -0700, elein wrote: > > default constraint > > ... > > elein=# insert into nulldefault values (NULL); > > ERROR:

Re: [GENERAL] null constraints and defaults

2005-06-29 Thread Matt Miller
On Wed, 2005-06-29 at 13:04 -0700, elein wrote: > default constraint > ... > elein=# insert into nulldefault values (NULL); > ERROR: null value in column "one" violates not-null constraint I think the idea of a DEFAULT value is to tell the DB what to supply only if you omit the column from the in

[GENERAL] null constraints and defaults

2005-06-29 Thread elein
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 inte