Re: conditional rule not applied
От | Seb |
---|---|
Тема | Re: conditional rule not applied |
Дата | |
Msg-id | 87iqbfnpzv.fsf@kolob.sebmags.homelinux.org обсуждение исходный текст |
Ответ на | conditional rule not applied (Seb <spluque@gmail.com>) |
Список | pgsql-general |
On Wed, 06 Jan 2010 09:39:45 -0600, Seb <spluque@gmail.com> wrote: > Would this express the intention any better? > CREATE RULE footwear_nothing_upd AS > ON UPDATE TO footwear DO INSTEAD NOTHING; > CREATE RULE footwear_newshoelaces_upd AS > ON UPDATE TO footwear > WHERE NOT EXISTS (SELECT sh_id FROM shoelaces WHERE NEW.sh_id=shoelaces.sh_id) > DO > INSERT INTO shoelaces (sh_id, sl_name) > VALUES(NEW.sh_id, NEW.sl_name); Adding to my confusion here, is the fact that the rule above seems to work well, even though the docs say: ---<--------------------cut here---------------start------------------->--- condition Any SQL conditional expression (returning boolean). The condition expression cannot refer to any tables except NEW and OLD, and cannot contain aggregate functions. ---<--------------------cut here---------------end--------------------->--- So the WHERE condition in the rule above should not be allowed since it does reference a table other than NEW and OLD in the EXISTS statement. Any enlightening comments appreciated. -- Seb
В списке pgsql-general по дате отправления: