please find attached an implementation for updatable views. Included are
for pg_dump and information_schema, regression test and documentation are
missing. Also, there's currently no upgrade path for older PostgreSQL
user defined rules on views. I have some code which drops the implicit
rules silently if someone wants to have its own rule, but this needs some
The patch covers the whole SQL92 functionality and doesn't create any
a given view is considered not to be compatible with SQL92 definitions. The
CREATE VIEW foo AS .... [ WITH [ CASCADED | LOCAL ] CHECK OPTION ]
The check option is implemented as a conditional rule with a simple system
checks the given expression tree to be true or false and raises an error in
the latter case.
There's also a little change in the rewriter semantics, as i treat implicit
(view update rules
created automatically) and explicit rules (rules created by any user)
This involves some changes to the system catalog (especially
pg_rewrite and pg_proc), so be prepared to do an initdb. There are new files
in src/backend/rewrite/view_update.c and src/include/rewrite/view_update.h,
Please note that the patch currently breaks some regression tests, but
mostly due to duplicated rules on views and additional notice messages.
have dropped support for updatable views which contains indexed array
of tables (like SELECT foo, foo FROM bar). These are treated
someone needs his own rules here.
I hope there aren't too many open points here, so this patch could be
for inclusion in 8.2.
Looking forward your opinions...
pgsql-patches by date
|Next:||From: Andrew Dunstan||Date: 2006-07-25 16:41:41|
|Subject: Re: [HACKERS] Patch for VS.Net 2005's strxfrm() bug|
|Previous:||From: Hiroshi Saito||Date: 2006-07-25 16:30:23|
|Subject: Re: [HACKERS] Patch for VS.Net 2005's strxfrm() bug |