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 OLD.fixed = TRUE DO INSTEAD NOTHING;

-Nick Johnson

---------------------------(end of broadcast)---------------------------
TIP 6: Have you searched our list archives?

              http://archives.postgresql.org

Reply via email to