From: | Peter Eisentraut <peter_e(at)gmx(dot)net> |
---|---|
To: | Bernd Helmle <mailings(at)oopsware(dot)de> |
Cc: | pgsql-hackers(at)postgresql(dot)org |
Subject: | Re: WIP: Automatic view update rules |
Date: | 2009-01-19 09:39:07 |
Message-ID: | 49744A3B.1060606@gmx.net |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
Bernd Helmle wrote:
> --On Samstag, Januar 17, 2009 02:01:15 +0200 Peter Eisentraut
> <peter_e(at)gmx(dot)net> wrote:
>
>> * It is not clear how automatic rules and manual DO ALSO rules should
>> interact. A manual DO ALSO rule will currently clear out an automatic
>> INSTEAD rule, which I find to be illogical.
>
> My intentional feeling was that it would be a bad idea to leave any
> implicit rule when someone is going to create his own rule set on a
> view, at least to avoid any confusion or side effects. Consider someone
> having his own rules upgrading from an older version. He must have at
> least his own DO INSTEAD Rule, it doesn't make any sense to have his own
> DO ALSO Rule without an INSTEAD one. Thus, doing it this way will leave
> the view as expected from the original setup.
>
> *thinking more*...if we teach explicit DO ALSO rules *not* to clean out
> implicit ones, we will have the following workflows:
>
> a) View is updatable, has its own automatic DO INSTEAD rule: if someone
> is restoring his old update rules, he will have at least his own DO
> INSTEAD rule. This will drop any corresponding automatically created
> rule, adding his own DO INSTEAD rule and any DO ALSO rule.
>
> b) View is updatable, has its own automatic DO INSTEAD rule: The user is
> able to create any additional DO ALSO rule.
>
> I don't see any problems here, as long as the implicit DO INSTEAD rule
> gets replaced.
Someone who previously had a DO INSTEAD rule to effect updatable views
as well as a DO ALSO rule to create some side effect (e.g.,
auditing/logging), will after the upgrade perhaps want to rely on the
automatic view update rules but will still want to create his own DO
ALSO rule. In the current patch, the creation of the DO ALSO rule will
delete the automatic view update rules, thus breaking the entire scenario.
Considering that the updatable views feature deals only with DO INSTEAD
rules, we should leave DO ALSO rules completely alone.
From | Date | Subject | |
---|---|---|---|
Next Message | Simon Riggs | 2009-01-19 09:49:07 | Re: FATAL: could not open relation pg_tblspc/491086/467369/491103: No such file or directory |
Previous Message | Magnus Hagander | 2009-01-19 09:23:12 | Re: libpq WSACleanup is not needed |