how to create rule as on delete

Поиск
Список
Период
Сортировка
От efa din
Тема how to create rule as on delete
Дата
Msg-id 20051019044334.51090.qmail@web33302.mail.mud.yahoo.com
обсуждение исходный текст
Ответы Re: how to create rule as on delete
Список pgsql-sql
This is my rule for doing the delete event. The rule
can be created. But the problem is, after the record
has been deleted from the 'mytable', this record
cannot be inserted into table 'maytable_log'.

CREATE RULE on_delete AS ON DELETE TO mytable DO
INSERT INTO mytable_log values (old.id,old.name);                


If I add the DO INSTEAD,the record can be inserted
into 'maytable_log' and also still remain in the table
'maytable'. Which is exactly not exist at all. It just
show it as im using the DO INSTEAD.

CREATE RULE on_delete AS ON DELETE TO mytable DO
INSTEAD INSERT INTO mytable_log values
(old.id,old.name); 

My problem is, how to insert the deleted record into
table 'mytable_log' without showing it in table
'maytable'. I really need the solution..please
                                  

    
__________________________________ 
Yahoo! Mail - PC Magazine Editors' Choice 2005 
http://mail.yahoo.com


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

Предыдущее
От: Bruno Wolff III
Дата:
Сообщение: Re: query tables based on a query
Следующее
От: Sarah Asmaels
Дата:
Сообщение: writable joined view