Jaime Casanova <jcasa...@systemguards.com.ec> writes: > On Fri, Jan 23, 2009 at 5:32 PM, Tom Lane <t...@sss.pgh.pa.us> wrote: >> Perhaps the right answer is to invent some new rule syntax to "redirect" >> inserts/updates/deletes, say something like >> on update to foo do instead redirect to bar
> and what about default values? I don't see the issue. View defaults would get inserted the same way they are now. There is another thing that's bothering me, though, which is that the present approach to dumping rules isn't adequate. Consider the following scenario: 1. You create a view that the system considers updatable, so it creates some automatic rules. 2. You don't want those rules, so you delete them, leaving you with the traditional behavior where attempted inserts etc on the view fail. 3. All is well until you dump and restore, whereupon you'll be swearing at those ^...@#! rules having come back. I think that we probably want the rules to show up automatically during an upgrade from an older version, but it does not follow that they should come back after being intentionally removed from an 8.4 installation. (This is *particularly* true if we are unable to squash every last one of the semantic gotchas; but even if we can, it's not impossible that someone might want the no-update behavior for some views.) We could imagine attaching a "no auto rules please" property to views (hm, perhaps this is an application for reloptions for a view). Or we could invent a new rule action type "DO INSTEAD ERROR", so that you could get the failure behavior as the result of a rule manually substituted for the automatic ones. But right now there's a hole in the definition. regards, tom lane -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers