diff options
| author | Tom Lane | 2001-07-09 23:50:32 +0000 |
|---|---|---|
| committer | Tom Lane | 2001-07-09 23:50:32 +0000 |
| commit | cb052e0bf139c3e51def0966e328f1f5779e442a (patch) | |
| tree | 4373d5db3ad1595893c2e31ae6382687f7d2e446 /src/test | |
| parent | 4fe42dfbc3bafa0ea615239d716a6b37d67da253 (diff) | |
Fix rule rewriter so that new ordering of ON INSERT actions applies
in cases of qualified rules as well as unqualified ones. Tweak rules
test to avoid cluttering output with dummy SELECT results. Update
documentation to match code.
Diffstat (limited to 'src/test')
| -rw-r--r-- | src/test/regress/expected/rules.out | 4 | ||||
| -rw-r--r-- | src/test/regress/sql/rules.sql | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/src/test/regress/expected/rules.out b/src/test/regress/expected/rules.out index 1c4fabd28b..acf6aa47f0 100644 --- a/src/test/regress/expected/rules.out +++ b/src/test/regress/expected/rules.out @@ -107,7 +107,7 @@ create table rtest_nothn2 (a int4, b text); create table rtest_nothn3 (a int4, b text); create table rtest_nothn4 (a int4, b text); create rule rtest_nothn_r1 as on insert to rtest_nothn1 - where new.a >= 10 and new.a < 20 do instead (select 1); + where new.a >= 10 and new.a < 20 do instead nothing; create rule rtest_nothn_r2 as on insert to rtest_nothn1 where new.a >= 30 and new.a < 40 do instead nothing; create rule rtest_nothn_r3 as on insert to rtest_nothn2 @@ -1313,7 +1313,7 @@ SELECT tablename, rulename, definition FROM pg_rules rtest_emp | rtest_emp_del | CREATE RULE rtest_emp_del AS ON DELETE TO rtest_emp DO INSERT INTO rtest_emplog (ename, who, "action", newsal, oldsal) VALUES (old.ename, "current_user"(), 'fired '::bpchar, '$0.00'::money, old.salary); rtest_emp | rtest_emp_ins | CREATE RULE rtest_emp_ins AS ON INSERT TO rtest_emp DO INSERT INTO rtest_emplog (ename, who, "action", newsal, oldsal) VALUES (new.ename, "current_user"(), 'hired '::bpchar, new.salary, '$0.00'::money); rtest_emp | rtest_emp_upd | CREATE RULE rtest_emp_upd AS ON UPDATE TO rtest_emp WHERE (new.salary <> old.salary) DO INSERT INTO rtest_emplog (ename, who, "action", newsal, oldsal) VALUES (new.ename, "current_user"(), 'honored '::bpchar, new.salary, old.salary); - rtest_nothn1 | rtest_nothn_r1 | CREATE RULE rtest_nothn_r1 AS ON INSERT TO rtest_nothn1 WHERE ((new.a >= 10) AND (new.a < 20)) DO INSTEAD SELECT 1; + rtest_nothn1 | rtest_nothn_r1 | CREATE RULE rtest_nothn_r1 AS ON INSERT TO rtest_nothn1 WHERE ((new.a >= 10) AND (new.a < 20)) DO INSTEAD NOTHING; rtest_nothn1 | rtest_nothn_r2 | CREATE RULE rtest_nothn_r2 AS ON INSERT TO rtest_nothn1 WHERE ((new.a >= 30) AND (new.a < 40)) DO INSTEAD NOTHING; rtest_nothn2 | rtest_nothn_r3 | CREATE RULE rtest_nothn_r3 AS ON INSERT TO rtest_nothn2 WHERE (new.a >= 100) DO INSTEAD INSERT INTO rtest_nothn3 (a, b) VALUES (new.a, new.b); rtest_nothn2 | rtest_nothn_r4 | CREATE RULE rtest_nothn_r4 AS ON INSERT TO rtest_nothn2 DO INSTEAD NOTHING; diff --git a/src/test/regress/sql/rules.sql b/src/test/regress/sql/rules.sql index 9a04ed3a3d..5068face88 100644 --- a/src/test/regress/sql/rules.sql +++ b/src/test/regress/sql/rules.sql @@ -131,7 +131,7 @@ create table rtest_nothn3 (a int4, b text); create table rtest_nothn4 (a int4, b text); create rule rtest_nothn_r1 as on insert to rtest_nothn1 - where new.a >= 10 and new.a < 20 do instead (select 1); + where new.a >= 10 and new.a < 20 do instead nothing; create rule rtest_nothn_r2 as on insert to rtest_nothn1 where new.a >= 30 and new.a < 40 do instead nothing; |
