Update remaining tests for new psql, with the exception of 'arrays'.

This commit is contained in:
Tom Lane 2000-01-09 03:50:27 +00:00
parent 260b6afc79
commit f5b754a492

View File

@ -1,49 +1,87 @@
QUERY: UPDATE onek --
-- MISC
--
--
-- BTREE
--
UPDATE onek
SET unique1 = onek.unique1 + 1; SET unique1 = onek.unique1 + 1;
QUERY: UPDATE onek UPDATE onek
SET unique1 = onek.unique1 - 1; SET unique1 = onek.unique1 - 1;
QUERY: UPDATE tmp --
-- BTREE partial
--
-- UPDATE onek2
-- SET unique1 = onek2.unique1 + 1;
--UPDATE onek2
-- SET unique1 = onek2.unique1 - 1;
--
-- BTREE shutting out non-functional updates
--
-- the following two tests seem to take a long time on some
-- systems. This non-func update stuff needs to be examined
-- more closely. - jolly (2/22/96)
--
UPDATE tmp
SET stringu1 = reverse_name(onek.stringu1) SET stringu1 = reverse_name(onek.stringu1)
WHERE onek.stringu1 = 'JBAAAA' and WHERE onek.stringu1 = 'JBAAAA' and
onek.stringu1 = tmp.stringu1; onek.stringu1 = tmp.stringu1;
QUERY: UPDATE tmp UPDATE tmp
SET stringu1 = reverse_name(onek2.stringu1) SET stringu1 = reverse_name(onek2.stringu1)
WHERE onek2.stringu1 = 'JCAAAA' and WHERE onek2.stringu1 = 'JCAAAA' and
onek2.stringu1 = tmp.stringu1; onek2.stringu1 = tmp.stringu1;
QUERY: DROP TABLE tmp; DROP TABLE tmp;
QUERY: COPY onek TO '_OBJWD_/results/onek.data'; --UPDATE person*
QUERY: DELETE FROM onek; -- SET age = age + 1;
QUERY: COPY onek FROM '_OBJWD_/results/onek.data'; --UPDATE person*
QUERY: SELECT unique1 FROM onek WHERE unique1 < 2; -- SET age = age + 3
-- WHERE name = 'linda';
--
-- copy
--
COPY onek TO '_OBJWD_/results/onek.data';
DELETE FROM onek;
COPY onek FROM '_OBJWD_/results/onek.data';
SELECT unique1 FROM onek WHERE unique1 < 2;
unique1 unique1
------- ---------
0 0
1 1
(2 rows) (2 rows)
QUERY: DELETE FROM onek2; DELETE FROM onek2;
QUERY: COPY onek2 FROM '_OBJWD_/results/onek.data'; COPY onek2 FROM '_OBJWD_/results/onek.data';
QUERY: SELECT unique1 FROM onek2 WHERE unique1 < 2; SELECT unique1 FROM onek2 WHERE unique1 < 2;
unique1 unique1
------- ---------
0 0
1 1
(2 rows) (2 rows)
QUERY: COPY BINARY stud_emp TO '_OBJWD_/results/stud_emp.data'; COPY BINARY stud_emp TO '_OBJWD_/results/stud_emp.data';
QUERY: DELETE FROM stud_emp; DELETE FROM stud_emp;
QUERY: COPY BINARY stud_emp FROM '_OBJWD_/results/stud_emp.data'; COPY BINARY stud_emp FROM '_OBJWD_/results/stud_emp.data';
QUERY: SELECT * FROM stud_emp; SELECT * FROM stud_emp;
name | age | location | salary | manager | gpa | percent name | age | location | salary | manager | gpa | percent
-----+---+----------+------+-------+---+------- -------+-----+------------+--------+---------+-----+---------
jeff | 23 | (8,7.7) | 600 | sharon | 3.5 | jeff | 23 | (8,7.7) | 600 | sharon | 3.5 |
cim | 30 | (10.5,4.7) | 400 | | 3.4 | cim | 30 | (10.5,4.7) | 400 | | 3.4 |
linda | 19 | (0.9,6.1) | 100 | | 2.9 | linda | 19 | (0.9,6.1) | 100 | | 2.9 |
(3 rows) (3 rows)
QUERY: SELECT * FROM a_star*; -- COPY aggtest FROM stdin;
-- 56 7.8
-- 100 99.097
-- 0 0.09561
-- 42 324.78
-- .
-- COPY aggtest TO stdout;
--
-- inheritance stress test
--
SELECT * FROM a_star*;
class | a class | a
-----+-- -------+----
a | 1 a | 1
a | 2 a | 2
a | a |
@ -96,19 +134,19 @@ f |
f | f |
(50 rows) (50 rows)
QUERY: SELECT * SELECT *
FROM b_star* x FROM b_star* x
WHERE x.b = 'bumble'::text or x.a < 3; WHERE x.b = text 'bumble' or x.a < 3;
class | a | b class | a | b
-----+-+------ -------+---+--------
b | | bumble b | | bumble
(1 row) (1 row)
QUERY: SELECT class, a SELECT class, a
FROM c_star* x FROM c_star* x
WHERE x.c ~ 'hi'::text; WHERE x.c ~ text 'hi';
class | a class | a
-----+-- -------+----
c | 5 c | 5
c | c |
d | 7 d | 7
@ -133,11 +171,11 @@ f |
f | f |
(22 rows) (22 rows)
QUERY: SELECT class, b, c SELECT class, b, c
FROM d_star* x FROM d_star* x
WHERE x.a < 100; WHERE x.a < 100;
class | b | c class | b | c
-----+-------+---------- -------+---------+------------
d | grumble | hi sunita d | grumble | hi sunita
d | stumble | hi koko d | stumble | hi koko
d | rumble | d | rumble |
@ -148,9 +186,9 @@ d | |
d | | d | |
(8 rows) (8 rows)
QUERY: SELECT class, c FROM e_star* x WHERE x.c NOTNULL; SELECT class, c FROM e_star* x WHERE x.c NOTNULL;
class | c class | c
-----+----------- -------+-------------
e | hi carol e | hi carol
e | hi bob e | hi bob
e | hi michelle e | hi michelle
@ -165,9 +203,9 @@ f |hi jeff
f | hi carl f | hi carl
(12 rows) (12 rows)
QUERY: SELECT * FROM f_star* x WHERE x.c ISNULL; SELECT * FROM f_star* x WHERE x.c ISNULL;
class | a | c | e | f class | a | c | e | f
-----+--+-+---+----------------------------------------- -------+----+---+-----+-------------------------------------------
f | 22 | | -7 | ((111,555),(222,666),(333,777),(444,888)) f | 22 | | -7 | ((111,555),(222,666),(333,777),(444,888))
f | 25 | | -9 | f | 25 | | -9 |
f | 26 | | | ((11111,33333),(22222,44444)) f | 26 | | | ((11111,33333),(22222,44444))
@ -178,15 +216,16 @@ f | | | |((11111111,33333333),(22222222,44444444))
f | | | | f | | | |
(8 rows) (8 rows)
QUERY: SELECT sum(a) FROM a_star*; -- grouping and aggregation on inherited sets have been busted in the past...
SELECT sum(a) FROM a_star*;
sum sum
--- -----
355 355
(1 row) (1 row)
QUERY: SELECT class, sum(a) FROM a_star* GROUP BY class; SELECT class, sum(a) FROM a_star* GROUP BY class;
class | sum class | sum
-----+--- -------+-----
a | 3 a | 3
b | 7 b | 7
c | 11 c | 11
@ -195,17 +234,17 @@ e | 66
f | 184 f | 184
(6 rows) (6 rows)
QUERY: ALTER TABLE f_star RENAME COLUMN f TO ff; ALTER TABLE f_star RENAME COLUMN f TO ff;
QUERY: ALTER TABLE e_star* RENAME COLUMN e TO ee; ALTER TABLE e_star* RENAME COLUMN e TO ee;
QUERY: ALTER TABLE d_star* RENAME COLUMN d TO dd; ALTER TABLE d_star* RENAME COLUMN d TO dd;
QUERY: ALTER TABLE c_star* RENAME COLUMN c TO cc; ALTER TABLE c_star* RENAME COLUMN c TO cc;
QUERY: ALTER TABLE b_star* RENAME COLUMN b TO bb; ALTER TABLE b_star* RENAME COLUMN b TO bb;
QUERY: ALTER TABLE a_star* RENAME COLUMN a TO aa; ALTER TABLE a_star* RENAME COLUMN a TO aa;
QUERY: SELECT class, aa SELECT class, aa
FROM a_star* x FROM a_star* x
WHERE aa ISNULL; WHERE aa ISNULL;
class | aa class | aa
-----+-- -------+----
a | a |
b | b |
b | b |
@ -232,21 +271,21 @@ f |
f | f |
(24 rows) (24 rows)
QUERY: ALTER TABLE a_star RENAME COLUMN aa TO foo; ALTER TABLE a_star RENAME COLUMN aa TO foo;
QUERY: 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) (1 row)
QUERY: ALTER TABLE a_star RENAME COLUMN foo TO aa; ALTER TABLE a_star RENAME COLUMN foo TO aa;
QUERY: SELECT * SELECT *
from a_star* from a_star*
WHERE aa < 1000; WHERE aa < 1000;
class | aa class | aa
-----+-- -------+----
a | 1 a | 1
a | 2 a | 2
b | 3 b | 3
@ -275,12 +314,13 @@ f |26
f | 27 f | 27
(26 rows) (26 rows)
QUERY: ALTER TABLE f_star ADD COLUMN f int4; ALTER TABLE f_star ADD COLUMN f int4;
QUERY: UPDATE f_star SET f = 10; UPDATE f_star SET f = 10;
QUERY: ALTER TABLE e_star* ADD COLUMN e int4; ALTER TABLE e_star* ADD COLUMN e int4;
QUERY: SELECT * FROM e_star*; --UPDATE e_star* SET e = 42;
SELECT * FROM e_star*;
class | aa | cc | ee | e class | aa | cc | ee | e
-----+--+-----------+---+- -------+----+-------------+-----+---
e | 15 | hi carol | -1 | e | 15 | hi carol | -1 |
e | 16 | hi bob | | e | 16 | hi bob | |
e | 17 | | -2 | e | 17 | | -2 |
@ -306,10 +346,13 @@ f | | | |
f | | | | f | | | |
(23 rows) (23 rows)
QUERY: ALTER TABLE a_star* ADD COLUMN a text; ALTER TABLE a_star* ADD COLUMN a text;
QUERY: SELECT class, aa, a FROM a_star*; --UPDATE b_star*
-- SET a = text 'gazpacho'
-- WHERE aa > 4;
SELECT class, aa, a FROM a_star*;
class | aa | a class | aa | a
-----+--+- -------+----+---
a | 1 | a | 1 |
a | 2 | a | 2 |
a | | a | |
@ -362,35 +405,53 @@ f | |
f | | f | |
(50 rows) (50 rows)
QUERY: SELECT p.name, p.hobbies.name FROM person p; --
-- versions
--
--
-- postquel functions
--
--
-- mike does post_hacking,
-- joe and sally play basketball, and
-- everyone else does nothing.
--
SELECT p.name, p.hobbies.name FROM person p;
name | name name | name
-----+----------- -------+-------------
mike | posthacking mike | posthacking
joe | basketball joe | basketball
sally | basketball sally | basketball
(3 rows) (3 rows)
QUERY: SELECT p.name, p.hobbies.name FROM person* p; --
-- as above, but jeff also does post_hacking.
--
SELECT p.name, p.hobbies.name FROM person* p;
name | name name | name
-----+----------- -------+-------------
mike | posthacking mike | posthacking
joe | basketball joe | basketball
sally | basketball sally | basketball
jeff | posthacking jeff | posthacking
(4 rows) (4 rows)
QUERY: SELECT DISTINCT hobbies_r.name, hobbies_r.equipment.name FROM hobbies_r; --
-- the next two queries demonstrate how functions generate bogus duplicates.
-- this is a "feature" ..
--
SELECT DISTINCT hobbies_r.name, hobbies_r.equipment.name FROM hobbies_r;
name | name name | name
-----------+------------- -------------+---------------
basketball | hightops basketball | hightops
posthacking | advil posthacking | advil
posthacking | peet's coffee posthacking | peet's coffee
skywalking | guts skywalking | guts
(4 rows) (4 rows)
QUERY: SELECT hobbies_r.name, hobbies_r.equipment.name FROM hobbies_r; SELECT hobbies_r.name, hobbies_r.equipment.name FROM hobbies_r;
name | name name | name
-----------+------------- -------------+---------------
posthacking | advil posthacking | advil
posthacking | peet's coffee posthacking | peet's coffee
posthacking | advil posthacking | advil
@ -400,18 +461,26 @@ basketball |hightops
skywalking | guts skywalking | guts
(7 rows) (7 rows)
QUERY: SELECT p.name, p.hobbies.name, p.hobbies.equipment.name FROM person p; --
-- mike needs advil and peet's coffee,
-- joe and sally need hightops, and
-- everyone else is fine.
--
SELECT p.name, p.hobbies.name, p.hobbies.equipment.name FROM person p;
name | name | name name | name | name
-----+-----------+------------- -------+-------------+---------------
mike | posthacking | advil mike | posthacking | advil
mike | posthacking | peet's coffee mike | posthacking | peet's coffee
joe | basketball | hightops joe | basketball | hightops
sally | basketball | hightops sally | basketball | hightops
(4 rows) (4 rows)
QUERY: SELECT p.name, p.hobbies.name, p.hobbies.equipment.name FROM person* p; --
-- as above, but jeff needs advil and peet's coffee as well.
--
SELECT p.name, p.hobbies.name, p.hobbies.equipment.name FROM person* p;
name | name | name name | name | name
-----+-----------+------------- -------+-------------+---------------
mike | posthacking | advil mike | posthacking | advil
mike | posthacking | peet's coffee mike | posthacking | peet's coffee
joe | basketball | hightops joe | basketball | hightops
@ -420,18 +489,22 @@ jeff |posthacking|advil
jeff | posthacking | peet's coffee jeff | posthacking | peet's coffee
(6 rows) (6 rows)
QUERY: SELECT p.hobbies.equipment.name, p.name, p.hobbies.name FROM person p; --
-- just like the last two, but make sure that the target list fixup and
-- unflattening is being done correctly.
--
SELECT p.hobbies.equipment.name, p.name, p.hobbies.name FROM person p;
name | name | name name | name | name
-------------+-----+----------- ---------------+-------+-------------
advil | mike | posthacking advil | mike | posthacking
peet's coffee | mike | posthacking peet's coffee | mike | posthacking
hightops | joe | basketball hightops | joe | basketball
hightops | sally | basketball hightops | sally | basketball
(4 rows) (4 rows)
QUERY: 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;
name | name | name name | name | name
-------------+-----+----------- ---------------+-------+-------------
advil | mike | posthacking advil | mike | posthacking
peet's coffee | mike | posthacking peet's coffee | mike | posthacking
hightops | joe | basketball hightops | joe | basketball
@ -440,18 +513,18 @@ advil |jeff |posthacking
peet's coffee | jeff | posthacking peet's coffee | jeff | posthacking
(6 rows) (6 rows)
QUERY: 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;
name | name | name name | name | name
-------------+-----------+----- ---------------+-------------+-------
advil | posthacking | mike advil | posthacking | mike
peet's coffee | posthacking | mike peet's coffee | posthacking | mike
hightops | basketball | joe hightops | basketball | joe
hightops | basketball | sally hightops | basketball | sally
(4 rows) (4 rows)
QUERY: 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;
name | name | name name | name | name
-------------+-----------+----- ---------------+-------------+-------
advil | posthacking | mike advil | posthacking | mike
peet's coffee | posthacking | mike peet's coffee | posthacking | mike
hightops | basketball | joe hightops | basketball | joe
@ -460,10 +533,10 @@ advil |posthacking|jeff
peet's coffee | posthacking | jeff peet's coffee | posthacking | jeff
(6 rows) (6 rows)
QUERY: SELECT user_relns() AS user_relns SELECT user_relns() AS user_relns
ORDER BY user_relns; ORDER BY user_relns;
user_relns user_relns
--------------- ---------------------
a_star a_star
abstime_tbl abstime_tbl
aggtest aggtest
@ -510,7 +583,19 @@ int2_tbl
int4_tbl int4_tbl
int8_tbl int8_tbl
iportaltest iportaltest
join3_tbl
join4_tbl
lseg_tbl lseg_tbl
num_data
num_exp_add
num_exp_div
num_exp_ln
num_exp_log10
num_exp_mul
num_exp_power_10_ln
num_exp_sqrt
num_exp_sub
num_result
onek onek
onek2 onek2
path_tbl path_tbl
@ -536,5 +621,15 @@ tinterval_tbl
toyemp toyemp
varchar_tbl varchar_tbl
xacttest xacttest
(72 rows) (84 rows)
--SELECT name(equipment(hobby_construct(text 'skywalking', text 'mer'))) AS equip_name;
--
-- functional joins
--
--
-- instance rules
--
--
-- rewrite rules
--