Re: RULE does not like the NOT EXISTS condition

2018-09-08 Thread Andrew Gierth
> "Andrew" == Andrew Gierth writes: > "Szima" == Szima Gábor writes: Szima> Hi! Szima> I found an "interest" in RULE's operation: Andrew> All non-trivial* rules are wrong, I should of course add: the solution is to use triggers instead, which are much easier to understand and have v

Re: RULE does not like the NOT EXISTS condition

2018-09-08 Thread Andrew Gierth
> "Szima" == Szima Gábor writes: Szima> Hi! Szima> I found an "interest" in RULE's operation: All non-trivial* rules are wrong, and this is a good illustration of why. CREATE RULE ruletest_rule AS ON INSERT TO ruletest DO INSERT INTO rulelog (id) VALUES (NEW.id); INSERT INTO ruletest (i

RULE does not like the NOT EXISTS condition

2018-09-08 Thread Szima Gábor
Hi! I found an "interest" in RULE's operation: CREATE TABLE ruletest (id int4); CREATE TABLE rulelog (id int4, ts timestamp NOT NULL DEFAULT current_timestamp); CREATE RULE ruletest_rule AS ON INSERT TO ruletest DO INSERT INTO rulelog (id) VALUES (NEW.id); INSERT INTO ruletest (id) VALUES (