blob: 4e91e473415a270df538b30c0417b5ba115b2abd (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
|
--
drop trigger del_customer on customer;
drop trigger del_vendor on vendor;
drop function del_customer();
drop function del_vendor();
--
create function del_customer() returns opaque as '
begin
delete from shipto where trans_id = old.id;
delete from customertax where customer_id = old.id;
delete from partscustomer where customer_id = old.id;
return NULL;
end;
' language 'plpgsql';
-- end function
--
create trigger del_customer after delete on customer for each row execute procedure del_customer();
-- end trigger
--
create function del_vendor() returns opaque as '
begin
delete from shipto where trans_id = old.id;
delete from vendortax where vendor_id = old.id;
delete from partsvendor where vendor_id = old.id;
return NULL;
end;
' language 'plpgsql';
-- end function
--
create trigger del_vendor after delete on vendor for each row execute procedure del_vendor();
-- end trigger
--
update defaults set version = '2.4.2';
|