summaryrefslogtreecommitdiff
path: root/src/test/regress/expected/rules.out
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2022-02-08 15:30:38 -0500
committerTom Lane <tgl@sss.pgh.pa.us>2022-02-08 15:30:38 -0500
commitcc50080a828dd4791b43539f5a0f976e535d147c (patch)
tree787184da35163d8be525b7f84af85083e50d152a /src/test/regress/expected/rules.out
parentba15f16107bea8a93edc505f3013cd7df4ac90fc (diff)
downloadpostgresql-cc50080a828dd4791b43539f5a0f976e535d147c.tar.gz
Rearrange core regression tests to reduce cross-script dependencies.
The idea behind this patch is to make it possible to run individual test scripts without running the entire core test suite. Making all the scripts completely independent would involve a massive rewrite, and would probably be worse for coverage of things like concurrent DDL. So this patch just does what seems practical with limited changes. The net effect is that any test script can be run after running limited earlier dependencies: * all scripts depend on test_setup * many scripts depend on create_index * other dependencies are few in number, and are documented in the parallel_schedule file. To accomplish this, I chose a small number of commonly-used tables and moved their creation and filling into test_setup. Later scripts are expected not to modify these tables' data contents, for fear of affecting other scripts' results. Also, our former habit of declaring all C functions in one place is now gone in favor of declaring them where they're used, if that's just one script, or in test_setup if necessary. There's more that could be done to remove some of the remaining inter-script dependencies, but significantly more-invasive changes would be needed, and at least for now it doesn't seem worth it. Discussion: https://postgr.es/m/1114748.1640383217@sss.pgh.pa.us
Diffstat (limited to 'src/test/regress/expected/rules.out')
-rw-r--r--src/test/regress/expected/rules.out216
1 files changed, 2 insertions, 214 deletions
diff --git a/src/test/regress/expected/rules.out b/src/test/regress/expected/rules.out
index d652f7b5fb..1420288d67 100644
--- a/src/test/regress/expected/rules.out
+++ b/src/test/regress/expected/rules.out
@@ -1283,30 +1283,8 @@ drop table cchild;
-- temporarily disable fancy output, so view changes create less diff noise
\a\t
SELECT viewname, definition FROM pg_views
-WHERE schemaname IN ('pg_catalog', 'public')
+WHERE schemaname = 'pg_catalog'
ORDER BY viewname;
-iexit| SELECT ih.name,
- ih.thepath,
- interpt_pp(ih.thepath, r.thepath) AS exit
- FROM ihighway ih,
- ramp r
- WHERE (ih.thepath ## r.thepath);
-key_dependent_view| SELECT view_base_table.key,
- view_base_table.data
- FROM view_base_table
- GROUP BY view_base_table.key;
-key_dependent_view_no_cols| SELECT
- FROM view_base_table
- GROUP BY view_base_table.key
- HAVING (length((view_base_table.data)::text) > 0);
-mvtest_tv| SELECT mvtest_t.type,
- sum(mvtest_t.amt) AS totamt
- FROM mvtest_t
- GROUP BY mvtest_t.type;
-mvtest_tvv| SELECT sum(mvtest_tv.totamt) AS grandtot
- FROM mvtest_tv;
-mvtest_tvvmv| SELECT mvtest_tvvm.grandtot
- FROM mvtest_tvvm;
pg_available_extension_versions| SELECT e.name,
e.version,
(x.extname IS NOT NULL) AS installed,
@@ -2592,204 +2570,14 @@ pg_views| SELECT n.nspname AS schemaname,
FROM (pg_class c
LEFT JOIN pg_namespace n ON ((n.oid = c.relnamespace)))
WHERE (c.relkind = 'v'::"char");
-rtest_v1| SELECT rtest_t1.a,
- rtest_t1.b
- FROM rtest_t1;
-rtest_vcomp| SELECT x.part,
- (x.size * y.factor) AS size_in_cm
- FROM rtest_comp x,
- rtest_unitfact y
- WHERE (x.unit = y.unit);
-rtest_vview1| SELECT x.a,
- x.b
- FROM rtest_view1 x
- WHERE (0 < ( SELECT count(*) AS count
- FROM rtest_view2 y
- WHERE (y.a = x.a)));
-rtest_vview2| SELECT rtest_view1.a,
- rtest_view1.b
- FROM rtest_view1
- WHERE rtest_view1.v;
-rtest_vview3| SELECT x.a,
- x.b
- FROM rtest_vview2 x
- WHERE (0 < ( SELECT count(*) AS count
- FROM rtest_view2 y
- WHERE (y.a = x.a)));
-rtest_vview4| SELECT x.a,
- x.b,
- count(y.a) AS refcount
- FROM rtest_view1 x,
- rtest_view2 y
- WHERE (x.a = y.a)
- GROUP BY x.a, x.b;
-rtest_vview5| SELECT rtest_view1.a,
- rtest_view1.b,
- rtest_viewfunc1(rtest_view1.a) AS refcount
- FROM rtest_view1;
-shoe| SELECT sh.shoename,
- sh.sh_avail,
- sh.slcolor,
- sh.slminlen,
- (sh.slminlen * un.un_fact) AS slminlen_cm,
- sh.slmaxlen,
- (sh.slmaxlen * un.un_fact) AS slmaxlen_cm,
- sh.slunit
- FROM shoe_data sh,
- unit un
- WHERE (sh.slunit = un.un_name);
-shoe_ready| SELECT rsh.shoename,
- rsh.sh_avail,
- rsl.sl_name,
- rsl.sl_avail,
- int4smaller(rsh.sh_avail, rsl.sl_avail) AS total_avail
- FROM shoe rsh,
- shoelace rsl
- WHERE ((rsl.sl_color = rsh.slcolor) AND (rsl.sl_len_cm >= rsh.slminlen_cm) AND (rsl.sl_len_cm <= rsh.slmaxlen_cm));
-shoelace| SELECT s.sl_name,
- s.sl_avail,
- s.sl_color,
- s.sl_len,
- s.sl_unit,
- (s.sl_len * u.un_fact) AS sl_len_cm
- FROM shoelace_data s,
- unit u
- WHERE (s.sl_unit = u.un_name);
-shoelace_candelete| SELECT shoelace_obsolete.sl_name,
- shoelace_obsolete.sl_avail,
- shoelace_obsolete.sl_color,
- shoelace_obsolete.sl_len,
- shoelace_obsolete.sl_unit,
- shoelace_obsolete.sl_len_cm
- FROM shoelace_obsolete
- WHERE (shoelace_obsolete.sl_avail = 0);
-shoelace_obsolete| SELECT shoelace.sl_name,
- shoelace.sl_avail,
- shoelace.sl_color,
- shoelace.sl_len,
- shoelace.sl_unit,
- shoelace.sl_len_cm
- FROM shoelace
- WHERE (NOT (EXISTS ( SELECT shoe.shoename
- FROM shoe
- WHERE (shoe.slcolor = shoelace.sl_color))));
-street| SELECT r.name,
- r.thepath,
- c.cname
- FROM ONLY road r,
- real_city c
- WHERE (c.outline ## r.thepath);
-test_tablesample_v1| SELECT test_tablesample.id
- FROM test_tablesample TABLESAMPLE system ((10 * 2)) REPEATABLE (2);
-test_tablesample_v2| SELECT test_tablesample.id
- FROM test_tablesample TABLESAMPLE system (99);
-toyemp| SELECT emp.name,
- emp.age,
- emp.location,
- (12 * emp.salary) AS annualsal
- FROM emp;
SELECT tablename, rulename, definition FROM pg_rules
-WHERE schemaname IN ('pg_catalog', 'public')
+WHERE schemaname = 'pg_catalog'
ORDER BY tablename, rulename;
pg_settings|pg_settings_n|CREATE RULE pg_settings_n AS
ON UPDATE TO pg_catalog.pg_settings DO INSTEAD NOTHING;
pg_settings|pg_settings_u|CREATE RULE pg_settings_u AS
ON UPDATE TO pg_catalog.pg_settings
WHERE (new.name = old.name) DO SELECT set_config(old.name, new.setting, false) AS set_config;
-rtest_emp|rtest_emp_del|CREATE RULE rtest_emp_del AS
- ON DELETE TO public.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 public.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 public.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 public.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 public.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 public.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 public.rtest_nothn2 DO INSTEAD NOTHING;
-rtest_order1|rtest_order_r1|CREATE RULE rtest_order_r1 AS
- ON INSERT TO public.rtest_order1 DO INSTEAD INSERT INTO rtest_order2 (a, b, c)
- VALUES (new.a, nextval('rtest_seq'::regclass), 'rule 1 - this should run 1st'::text);
-rtest_order1|rtest_order_r2|CREATE RULE rtest_order_r2 AS
- ON INSERT TO public.rtest_order1 DO INSERT INTO rtest_order2 (a, b, c)
- VALUES (new.a, nextval('rtest_seq'::regclass), 'rule 2 - this should run 2nd'::text);
-rtest_order1|rtest_order_r3|CREATE RULE rtest_order_r3 AS
- ON INSERT TO public.rtest_order1 DO INSTEAD INSERT INTO rtest_order2 (a, b, c)
- VALUES (new.a, nextval('rtest_seq'::regclass), 'rule 3 - this should run 3rd'::text);
-rtest_order1|rtest_order_r4|CREATE RULE rtest_order_r4 AS
- ON INSERT TO public.rtest_order1
- WHERE (new.a < 100) DO INSTEAD INSERT INTO rtest_order2 (a, b, c)
- VALUES (new.a, nextval('rtest_seq'::regclass), 'rule 4 - this should run 4th'::text);
-rtest_person|rtest_pers_del|CREATE RULE rtest_pers_del AS
- ON DELETE TO public.rtest_person DO DELETE FROM rtest_admin
- WHERE (rtest_admin.pname = old.pname);
-rtest_person|rtest_pers_upd|CREATE RULE rtest_pers_upd AS
- ON UPDATE TO public.rtest_person DO UPDATE rtest_admin SET pname = new.pname
- WHERE (rtest_admin.pname = old.pname);
-rtest_system|rtest_sys_del|CREATE RULE rtest_sys_del AS
- ON DELETE TO public.rtest_system DO ( DELETE FROM rtest_interface
- WHERE (rtest_interface.sysname = old.sysname);
- DELETE FROM rtest_admin
- WHERE (rtest_admin.sysname = old.sysname);
-);
-rtest_system|rtest_sys_upd|CREATE RULE rtest_sys_upd AS
- ON UPDATE TO public.rtest_system DO ( UPDATE rtest_interface SET sysname = new.sysname
- WHERE (rtest_interface.sysname = old.sysname);
- UPDATE rtest_admin SET sysname = new.sysname
- WHERE (rtest_admin.sysname = old.sysname);
-);
-rtest_t4|rtest_t4_ins1|CREATE RULE rtest_t4_ins1 AS
- ON INSERT TO public.rtest_t4
- WHERE ((new.a >= 10) AND (new.a < 20)) DO INSTEAD INSERT INTO rtest_t5 (a, b)
- VALUES (new.a, new.b);
-rtest_t4|rtest_t4_ins2|CREATE RULE rtest_t4_ins2 AS
- ON INSERT TO public.rtest_t4
- WHERE ((new.a >= 20) AND (new.a < 30)) DO INSERT INTO rtest_t6 (a, b)
- VALUES (new.a, new.b);
-rtest_t5|rtest_t5_ins|CREATE RULE rtest_t5_ins AS
- ON INSERT TO public.rtest_t5
- WHERE (new.a > 15) DO INSERT INTO rtest_t7 (a, b)
- VALUES (new.a, new.b);
-rtest_t6|rtest_t6_ins|CREATE RULE rtest_t6_ins AS
- ON INSERT TO public.rtest_t6
- WHERE (new.a > 25) DO INSTEAD INSERT INTO rtest_t8 (a, b)
- VALUES (new.a, new.b);
-rtest_v1|rtest_v1_del|CREATE RULE rtest_v1_del AS
- ON DELETE TO public.rtest_v1 DO INSTEAD DELETE FROM rtest_t1
- WHERE (rtest_t1.a = old.a);
-rtest_v1|rtest_v1_ins|CREATE RULE rtest_v1_ins AS
- ON INSERT TO public.rtest_v1 DO INSTEAD INSERT INTO rtest_t1 (a, b)
- VALUES (new.a, new.b);
-rtest_v1|rtest_v1_upd|CREATE RULE rtest_v1_upd AS
- ON UPDATE TO public.rtest_v1 DO INSTEAD UPDATE rtest_t1 SET a = new.a, b = new.b
- WHERE (rtest_t1.a = old.a);
-shoelace|shoelace_del|CREATE RULE shoelace_del AS
- ON DELETE TO public.shoelace DO INSTEAD DELETE FROM shoelace_data
- WHERE (shoelace_data.sl_name = old.sl_name);
-shoelace|shoelace_ins|CREATE RULE shoelace_ins AS
- ON INSERT TO public.shoelace DO INSTEAD INSERT INTO shoelace_data (sl_name, sl_avail, sl_color, sl_len, sl_unit)
- VALUES (new.sl_name, new.sl_avail, new.sl_color, new.sl_len, new.sl_unit);
-shoelace|shoelace_upd|CREATE RULE shoelace_upd AS
- ON UPDATE TO public.shoelace DO INSTEAD UPDATE shoelace_data SET sl_name = new.sl_name, sl_avail = new.sl_avail, sl_color = new.sl_color, sl_len = new.sl_len, sl_unit = new.sl_unit
- WHERE (shoelace_data.sl_name = old.sl_name);
-shoelace_data|log_shoelace|CREATE RULE log_shoelace AS
- ON UPDATE TO public.shoelace_data
- WHERE (new.sl_avail <> old.sl_avail) DO INSERT INTO shoelace_log (sl_name, sl_avail, log_who, log_when)
- VALUES (new.sl_name, new.sl_avail, 'Al Bundy'::name, 'Thu Jan 01 00:00:00 1970'::timestamp without time zone);
-shoelace_ok|shoelace_ok_ins|CREATE RULE shoelace_ok_ins AS
- ON INSERT TO public.shoelace_ok DO INSTEAD UPDATE shoelace SET sl_avail = (shoelace.sl_avail + new.ok_quant)
- WHERE (shoelace.sl_name = new.ok_name);
-- restore normal output mode
\a\t
--