Re: [SQL] preventing deletion of a row

2005-06-06 Thread Kenneth Gonsalves
On Tuesday 07 Jun 2005 11:29 am, Nick Johnson wrote: > >if the value of 'fixed' is TRUE, then this row cannot be deleted. > > How do i enforce this condition? > >   > > Try this: > CREATE RULE tablename_delete AS ON DELETE TO tablename WHERE > OLD.fixed = TRUE DO INSTEAD NOTHING; cool - thanks --

Re: [SQL] preventing deletion of a row

2005-06-06 Thread Nick Johnson
Kenneth Gonsalves wrote: hi i have a table of the type: id serial unique, name varchar(50), fixed boolean default FALSE if the value of 'fixed' is TRUE, then this row cannot be deleted. How do i enforce this condition? Try this: CREATE RULE tablename_delete AS ON DELETE TO tablename WHERE

[SQL] preventing deletion of a row

2005-06-06 Thread Kenneth Gonsalves
hi i have a table of the type: id serial unique, name varchar(50), fixed boolean default FALSE if the value of 'fixed' is TRUE, then this row cannot be deleted. How do i enforce this condition? -- regards kg http://www.livejournal.com/users/lawgon tally ho! http://avsap.sourceforge.net ಇಂಡ್ಲಿನ