Re: [SQL] Conditional NOT NULL constraint

2007-02-28 Thread Andreas Joseph Krogh
On Wednesday 28 February 2007, Richard Huxton wrote: > Andreas Joseph Krogh wrote: > > Hi all! > > Is there a simple way to add a "NOT NULL constraint" to a column without > > using a trigger if another column is not null? > > Something like this: > > > > CREATE TABLE activity( > > id SERIAL primar

Re: [SQL] Conditional NOT NULL constraint

2007-02-28 Thread Richard Huxton
Andreas Joseph Krogh wrote: Hi all! Is there a simple way to add a "NOT NULL constraint" to a column without using a trigger if another column is not null? Something like this: CREATE TABLE activity( id SERIAL primary key, name varchar not null, created timestamp not null default now(), modifi

[SQL] Conditional NOT NULL constraint

2007-02-28 Thread Andreas Joseph Krogh
Hi all! Is there a simple way to add a "NOT NULL constraint" to a column without using a trigger if another column is not null? Something like this: CREATE TABLE activity( id SERIAL primary key, name varchar not null, created timestamp not null default now(), modified timestamp, created_by intege