Need to know how rules work? - Mailing list pgsql-general

From Andre Lopes
Subject Need to know how rules work?
Date
Msg-id 18f98e681002161755n6f2d0fb9ufff974079e7cc3fa@mail.gmail.com
Whole thread Raw
List pgsql-general
Hi,
 
I have created this table:
 
[quote]
CREATE OR REPLACE VIEW "am_newsletter_distritos" AS
 select * from atm_newsletter_distritos;
 
CREATE OR REPLACE RULE "ins_am_newsletter_distritos" AS
 ON INSERT TO "am_newsletter_distritos"
 DO INSTEAD
  (insert into atm_newsletter_distritos (email, id_distrito) values (new.email, new.id_distrito));
 
CREATE OR REPLACE RULE "upd_am_newsletter_distritos" AS
 ON DELETE TO "am_newsletter_distritos"
 DO INSTEAD
  (delete from atm_newsletter_distritos where email = old.email);
[/quote]
 
With these delete rule I can delete using on WHERE clause other field that "email"?
 
Best Regards,

pgsql-general by date:

Previous
From: "Daniel Verite"
Date:
Subject: Re: No tables in postgres and template db
Next
From: Megha
Date:
Subject: pgpool error, pid not found!