can we implement the updatable view through rule system? - Mailing list pgsql-hackers

From postgresql
Subject can we implement the updatable view through rule system?
Date
Msg-id 200305131645765.SM01108@gaojun
Whole thread Raw
List pgsql-hackers
Hi, all  Many talks have been dealed with the updatable view. 
In postgresql, It seems that we can use the powerful rule system
to implement the update, insert, delete on view.   But could we give a generalized update rule for a view?  For
example,we can construct the following rule:  create table data(a int,b int,c int);  create view view_data as select *
fromdata where c=0;
 
  CREATE RULE view_data_update AS ON UPDATE TO view_data   DO INSTEAD   UPDATE data SET       a=(NEW.c),
b=(NEW.c);   If we submit the query" update view data set a=1 where b=2", we could not 
 
rely on the "view_data_update" to finish the task. and I can not find how I can 
find a correct generalized rule to implement the update on view.    In addition, could we just rely on the rule system
toimplement the updatable
 
view with "check option"? 
  Please give me some hint if you have some free time.
  Best regards
  Josh  



pgsql-hackers by date:

Previous
From: Peter Eisentraut
Date:
Subject: Re: GUC and postgresql.conf docs
Next
From: Peter Eisentraut
Date:
Subject: Re: LIKE indexing proposal