Rule "Delete"

Поиск
Список
Период
Сортировка
От Francois TETE
Тема Rule "Delete"
Дата
Msg-id 01bd9905$833337a0$0700a8c0@ft.asnieres.supranets.com
обсуждение исходный текст
Список pgsql-sql
Has anybody tried to use delete-rules with PostgreSQL 6.3 ?

I have a table named "ifTable" with columns "id" and "ifType" with an index
on "id".
and a table named "profilTable" with column "id" and some other columns.

Each time I insert a row in profilTable I want to insert a row in ifTable,
so
I created a rule :
create rule r1 as on insert to profilTable do insert into ifTable values
(new.id, 'profil');

I would like to automatically remove this entry in iftable when I delete the
corresponding row in profilTable, but my rule does not work (nothings
happens and/or
the backend crashes after displaying : "copyObject : don't know how to copy
XXX" ) :
create rule r2 as on delete to profilTable do delete from ifTable where
id=current.id;

Could anybody help me ?

---
François TETE
SupraNETS
25 rue des Bas - 92600 Asnières - FRANCE
  Mail : francois.tete@supranets.com
  Phone: +33 1 46 88 09 69
  Fax  : +33 1 47 90 65 56



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

Предыдущее
От: lynch@lscorp.com (Richard Lynch)
Дата:
Сообщение: cast text as date
Следующее
От: Herouth Maoz
Дата:
Сообщение: Re: [SQL] cast text as date