Commit 2ae20ef9 authored by Tom Lane's avatar Tom Lane

Update regression tests for ONLY and other recent changes.

parent 93690007
...@@ -19,7 +19,7 @@ SELECT avg(b) AS avg_107_943 FROM aggtest; ...@@ -19,7 +19,7 @@ SELECT avg(b) AS avg_107_943 FROM aggtest;
107.943 107.943
(1 row) (1 row)
SELECT avg(gpa) AS avg_3_4 FROM student; SELECT avg(gpa) AS avg_3_4 FROM ONLY student;
avg_3_4 avg_3_4
--------- ---------
3.4 3.4
...@@ -43,7 +43,7 @@ SELECT sum(b) AS avg_431_773 FROM aggtest; ...@@ -43,7 +43,7 @@ SELECT sum(b) AS avg_431_773 FROM aggtest;
431.773 431.773
(1 row) (1 row)
SELECT sum(gpa) AS avg_6_8 FROM student; SELECT sum(gpa) AS avg_6_8 FROM ONLY student;
avg_6_8 avg_6_8
--------- ---------
6.8 6.8
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
-- --
CREATE VIEW street AS CREATE VIEW street AS
SELECT r.name, r.thepath, c.cname AS cname SELECT r.name, r.thepath, c.cname AS cname
FROM road r, real_city c FROM ONLY road r, real_city c
WHERE c.outline ## r.thepath; WHERE c.outline ## r.thepath;
CREATE VIEW iexit AS CREATE VIEW iexit AS
SELECT ih.name, ih.thepath, SELECT ih.name, ih.thepath,
......
...@@ -1168,7 +1168,7 @@ SELECT viewname, definition FROM pg_views ORDER BY viewname; ...@@ -1168,7 +1168,7 @@ SELECT viewname, definition FROM pg_views ORDER BY viewname;
pg_indexes | SELECT c.relname AS tablename, i.relname AS indexname, pg_get_indexdef(x.indexrelid) AS indexdef FROM pg_index x, pg_class c, pg_class i WHERE ((c.oid = x.indrelid) AND (i.oid = x.indexrelid)); pg_indexes | SELECT c.relname AS tablename, i.relname AS indexname, pg_get_indexdef(x.indexrelid) AS indexdef FROM pg_index x, pg_class c, pg_class i WHERE ((c.oid = x.indrelid) AND (i.oid = x.indexrelid));
pg_rules | SELECT c.relname AS tablename, r.rulename, pg_get_ruledef(r.rulename) AS definition FROM pg_rewrite r, pg_class c WHERE ((r.rulename !~ '^_RET'::text) AND (c.oid = r.ev_class)); pg_rules | SELECT c.relname AS tablename, r.rulename, pg_get_ruledef(r.rulename) AS definition FROM pg_rewrite r, pg_class c WHERE ((r.rulename !~ '^_RET'::text) AND (c.oid = r.ev_class));
pg_tables | SELECT c.relname AS tablename, pg_get_userbyid(c.relowner) AS tableowner, c.relhasindex AS hasindexes, c.relhasrules AS hasrules, (c.reltriggers > 0) AS hastriggers FROM pg_class c WHERE (((c.relkind = 'r'::"char") OR (c.relkind = 's'::"char")) AND (NOT (EXISTS (SELECT pg_rewrite.rulename FROM pg_rewrite WHERE ((pg_rewrite.ev_class = c.oid) AND (pg_rewrite.ev_type = '1'::"char")))))); pg_tables | SELECT c.relname AS tablename, pg_get_userbyid(c.relowner) AS tableowner, c.relhasindex AS hasindexes, c.relhasrules AS hasrules, (c.reltriggers > 0) AS hastriggers FROM pg_class c WHERE (((c.relkind = 'r'::"char") OR (c.relkind = 's'::"char")) AND (NOT (EXISTS (SELECT pg_rewrite.rulename FROM pg_rewrite WHERE ((pg_rewrite.ev_class = c.oid) AND (pg_rewrite.ev_type = '1'::"char"))))));
pg_user | SELECT pg_shadow.usename, pg_shadow.usesysid, pg_shadow.usecreatedb, pg_shadow.usetrace, pg_shadow.usesuper, pg_shadow.usecatupd, '********'::text AS passwd, pg_shadow.valuntil FROM pg_shadow; pg_user | SELECT pg_shadow.usename, pg_shadow.usesysid, pg_shadow.usecreatedb, pg_shadow.usecreatetable, pg_shadow.uselocktable, pg_shadow.usetrace, pg_shadow.usesuper, pg_shadow.usecatupd, '********'::text AS passwd, pg_shadow.valuntil FROM pg_shadow;
pg_views | SELECT c.relname AS viewname, pg_get_userbyid(c.relowner) AS viewowner, pg_get_viewdef(c.relname) AS definition FROM pg_class c WHERE (c.relhasrules AND (EXISTS (SELECT r.rulename FROM pg_rewrite r WHERE ((r.ev_class = c.oid) AND (r.ev_type = '1'::"char"))))); pg_views | SELECT c.relname AS viewname, pg_get_userbyid(c.relowner) AS viewowner, pg_get_viewdef(c.relname) AS definition FROM pg_class c WHERE (c.relhasrules AND (EXISTS (SELECT r.rulename FROM pg_rewrite r WHERE ((r.ev_class = c.oid) AND (r.ev_type = '1'::"char")))));
rtest_v1 | SELECT rtest_t1.a, rtest_t1.b FROM rtest_t1; 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_vcomp | SELECT x.part, (x.size * y.factor) AS size_in_cm FROM rtest_comp x, rtest_unitfact y WHERE (x.unit = y.unit);
...@@ -1182,7 +1182,7 @@ SELECT viewname, definition FROM pg_views ORDER BY viewname; ...@@ -1182,7 +1182,7 @@ SELECT viewname, definition FROM pg_views ORDER BY viewname;
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 | 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_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)))); 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 road r, real_city c WHERE (c.outline ## r.thepath); street | SELECT r.name, r.thepath, c.cname FROM ONLY road r, real_city c WHERE (c.outline ## r.thepath);
toyemp | SELECT emp.name, emp.age, emp."location", (12 * emp.salary) AS annualsal FROM emp; toyemp | SELECT emp.name, emp.age, emp."location", (12 * emp.salary) AS annualsal FROM emp;
(20 rows) (20 rows)
......
...@@ -124,10 +124,13 @@ SELECT class, aa ...@@ -124,10 +124,13 @@ SELECT class, aa
FROM a_star* x FROM a_star* x
WHERE aa ISNULL; WHERE aa ISNULL;
-- As of Postgres 7.1, ALTER implicitly recurses,
-- so this should be same as ALTER a_star*
ALTER TABLE a_star RENAME COLUMN aa TO foo; ALTER TABLE a_star RENAME COLUMN aa TO foo;
SELECT class, foo SELECT class, foo
FROM a_star x FROM a_star* x
WHERE x.foo >= 2; WHERE x.foo >= 2;
ALTER TABLE a_star RENAME COLUMN foo TO aa; ALTER TABLE a_star RENAME COLUMN foo TO aa;
...@@ -167,7 +170,7 @@ SELECT class, aa, a FROM a_star*; ...@@ -167,7 +170,7 @@ SELECT class, aa, a FROM a_star*;
-- joe and sally play basketball, and -- joe and sally play basketball, and
-- everyone else does nothing. -- everyone else does nothing.
-- --
SELECT p.name, p.hobbies.name FROM person p; SELECT p.name, p.hobbies.name FROM ONLY person p;
-- --
-- as above, but jeff also does post_hacking. -- as above, but jeff also does post_hacking.
...@@ -187,7 +190,7 @@ SELECT hobbies_r.name, hobbies_r.equipment.name FROM hobbies_r; ...@@ -187,7 +190,7 @@ SELECT hobbies_r.name, hobbies_r.equipment.name FROM hobbies_r;
-- joe and sally need hightops, and -- joe and sally need hightops, and
-- everyone else is fine. -- everyone else is fine.
-- --
SELECT p.name, p.hobbies.name, p.hobbies.equipment.name FROM person p; SELECT p.name, p.hobbies.name, p.hobbies.equipment.name FROM ONLY person p;
-- --
-- as above, but jeff needs advil and peet's coffee as well. -- as above, but jeff needs advil and peet's coffee as well.
...@@ -198,11 +201,11 @@ SELECT p.name, p.hobbies.name, p.hobbies.equipment.name FROM person* p; ...@@ -198,11 +201,11 @@ SELECT p.name, p.hobbies.name, p.hobbies.equipment.name FROM person* p;
-- just like the last two, but make sure that the target list fixup and -- just like the last two, but make sure that the target list fixup and
-- unflattening is being done correctly. -- unflattening is being done correctly.
-- --
SELECT p.hobbies.equipment.name, p.name, p.hobbies.name FROM person p; SELECT p.hobbies.equipment.name, p.name, p.hobbies.name FROM ONLY person p;
SELECT p.hobbies.equipment.name, p.name, p.hobbies.name FROM person* p; SELECT p.hobbies.equipment.name, p.name, p.hobbies.name FROM person* p;
SELECT p.hobbies.equipment.name, p.hobbies.name, p.name FROM person p; SELECT p.hobbies.equipment.name, p.hobbies.name, p.name FROM ONLY person p;
SELECT p.hobbies.equipment.name, p.hobbies.name, p.name FROM person* p; SELECT p.hobbies.equipment.name, p.hobbies.name, p.name FROM person* p;
......
...@@ -271,14 +271,40 @@ SELECT class, aa ...@@ -271,14 +271,40 @@ SELECT class, aa
f | f |
(24 rows) (24 rows)
-- As of Postgres 7.1, ALTER implicitly recurses,
-- so this should be same as ALTER a_star*
ALTER TABLE a_star RENAME COLUMN aa TO foo; ALTER TABLE a_star RENAME COLUMN aa TO foo;
SELECT class, foo SELECT class, foo
FROM a_star x FROM a_star* x
WHERE x.foo >= 2; WHERE x.foo >= 2;
class | foo class | foo
-------+----- -------+-----
a | 2 a | 2
(1 row) b | 3
b | 4
c | 5
c | 6
d | 7
d | 8
d | 9
d | 10
d | 11
d | 12
d | 13
d | 14
e | 15
e | 16
e | 17
e | 18
f | 19
f | 20
f | 21
f | 22
f | 24
f | 25
f | 26
f | 27
(25 rows)
ALTER TABLE a_star RENAME COLUMN foo TO aa; ALTER TABLE a_star RENAME COLUMN foo TO aa;
SELECT * SELECT *
...@@ -416,7 +442,7 @@ SELECT class, aa, a FROM a_star*; ...@@ -416,7 +442,7 @@ SELECT class, aa, a FROM a_star*;
-- joe and sally play basketball, and -- joe and sally play basketball, and
-- everyone else does nothing. -- everyone else does nothing.
-- --
SELECT p.name, p.hobbies.name FROM person p; SELECT p.name, p.hobbies.name FROM ONLY person p;
name | name name | name
-------+------------- -------+-------------
mike | posthacking mike | posthacking
...@@ -466,7 +492,7 @@ SELECT hobbies_r.name, hobbies_r.equipment.name FROM hobbies_r; ...@@ -466,7 +492,7 @@ SELECT hobbies_r.name, hobbies_r.equipment.name FROM hobbies_r;
-- joe and sally need hightops, and -- joe and sally need hightops, and
-- everyone else is fine. -- everyone else is fine.
-- --
SELECT p.name, p.hobbies.name, p.hobbies.equipment.name FROM person p; SELECT p.name, p.hobbies.name, p.hobbies.equipment.name FROM ONLY person p;
name | name | name name | name | name
-------+-------------+--------------- -------+-------------+---------------
mike | posthacking | advil mike | posthacking | advil
...@@ -493,7 +519,7 @@ SELECT p.name, p.hobbies.name, p.hobbies.equipment.name FROM person* p; ...@@ -493,7 +519,7 @@ SELECT p.name, p.hobbies.name, p.hobbies.equipment.name FROM person* p;
-- just like the last two, but make sure that the target list fixup and -- just like the last two, but make sure that the target list fixup and
-- unflattening is being done correctly. -- unflattening is being done correctly.
-- --
SELECT p.hobbies.equipment.name, p.name, p.hobbies.name FROM person p; SELECT p.hobbies.equipment.name, p.name, p.hobbies.name FROM ONLY person p;
name | name | name name | name | name
---------------+-------+------------- ---------------+-------+-------------
advil | mike | posthacking advil | mike | posthacking
...@@ -513,7 +539,7 @@ SELECT p.hobbies.equipment.name, p.name, p.hobbies.name FROM person* p; ...@@ -513,7 +539,7 @@ SELECT p.hobbies.equipment.name, p.name, p.hobbies.name FROM person* p;
peet's coffee | jeff | posthacking peet's coffee | jeff | posthacking
(6 rows) (6 rows)
SELECT p.hobbies.equipment.name, p.hobbies.name, p.name FROM person p; SELECT p.hobbies.equipment.name, p.hobbies.name, p.name FROM ONLY person p;
name | name | name name | name | name
---------------+-------------+------- ---------------+-------------+-------
advil | posthacking | mike advil | posthacking | mike
...@@ -537,10 +563,12 @@ SELECT user_relns() AS user_relns ...@@ -537,10 +563,12 @@ SELECT user_relns() AS user_relns
ORDER BY user_relns; ORDER BY user_relns;
user_relns user_relns
--------------------- ---------------------
a
a_star a_star
abstime_tbl abstime_tbl
aggtest aggtest
arrtest arrtest
b
b_star b_star
box_tbl box_tbl
bprime bprime
...@@ -548,6 +576,7 @@ SELECT user_relns() AS user_relns ...@@ -548,6 +576,7 @@ SELECT user_relns() AS user_relns
bt_i4_heap bt_i4_heap
bt_name_heap bt_name_heap
bt_txt_heap bt_txt_heap
c
c_star c_star
char_tbl char_tbl
check2_tbl check2_tbl
...@@ -556,6 +585,7 @@ SELECT user_relns() AS user_relns ...@@ -556,6 +585,7 @@ SELECT user_relns() AS user_relns
circle_tbl circle_tbl
city city
copy_tbl copy_tbl
d
d_star d_star
default_seq default_seq
default_tbl default_tbl
...@@ -623,7 +653,7 @@ SELECT user_relns() AS user_relns ...@@ -623,7 +653,7 @@ SELECT user_relns() AS user_relns
toyemp toyemp
varchar_tbl varchar_tbl
xacttest xacttest
(86 rows) (90 rows)
--SELECT name(equipment(hobby_construct(text 'skywalking', text 'mer'))) AS equip_name; --SELECT name(equipment(hobby_construct(text 'skywalking', text 'mer'))) AS equip_name;
-- --
......
...@@ -8,7 +8,7 @@ SELECT avg(a) AS avg_32 FROM aggtest WHERE a < 100; ...@@ -8,7 +8,7 @@ SELECT avg(a) AS avg_32 FROM aggtest WHERE a < 100;
SELECT avg(b) AS avg_107_943 FROM aggtest; SELECT avg(b) AS avg_107_943 FROM aggtest;
SELECT avg(gpa) AS avg_3_4 FROM student; SELECT avg(gpa) AS avg_3_4 FROM ONLY student;
SELECT sum(four) AS sum_1500 FROM onek; SELECT sum(four) AS sum_1500 FROM onek;
...@@ -17,7 +17,7 @@ SELECT sum(a) AS sum_198 FROM aggtest; ...@@ -17,7 +17,7 @@ SELECT sum(a) AS sum_198 FROM aggtest;
SELECT sum(b) AS avg_431_773 FROM aggtest; SELECT sum(b) AS avg_431_773 FROM aggtest;
SELECT sum(gpa) AS avg_6_8 FROM student; SELECT sum(gpa) AS avg_6_8 FROM ONLY student;
SELECT max(four) AS max_3 FROM onek; SELECT max(four) AS max_3 FROM onek;
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
CREATE VIEW street AS CREATE VIEW street AS
SELECT r.name, r.thepath, c.cname AS cname SELECT r.name, r.thepath, c.cname AS cname
FROM road r, real_city c FROM ONLY road r, real_city c
WHERE c.outline ## r.thepath; WHERE c.outline ## r.thepath;
CREATE VIEW iexit AS CREATE VIEW iexit AS
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment