Re: preventing deletion of a row

Поиск
Список
Период
Сортировка
От Nick Johnson
Тема Re: preventing deletion of a row
Дата
Msg-id 42A537B6.8040902@notdot.net
обсуждение исходный текст
Ответ на preventing deletion of a row  (Kenneth Gonsalves <lawgon@thenilgiris.com>)
Ответы Re: preventing deletion of a row
Список pgsql-sql
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


В списке pgsql-sql по дате отправления:

Предыдущее
От: Kenneth Gonsalves
Дата:
Сообщение: datestyle syntax
Следующее
От: Vadivel Subramaniam
Дата:
Сообщение: large object support in PostGres 7.4