Commit f5b754a4 authored by Tom Lane's avatar Tom Lane

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

parent 260b6afc
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
unique1 -- WHERE name = 'linda';
------- --
0 -- copy
1 --
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
---------
0
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;
class| a -- 56 7.8
-----+-- -- 100 99.097
a | 1 -- 0 0.09561
a | 2 -- 42 324.78
a | -- .
b | 3 -- COPY aggtest TO stdout;
b | 4 --
b | -- inheritance stress test
b | --
c | 5 SELECT * FROM a_star*;
c | 6 class | a
c | -------+----
c | a | 1
d | 7 a | 2
d | 8 a |
d | 9 b | 3
d |10 b | 4
d | b |
d |11 b |
d |12 c | 5
d |13 c | 6
d | c |
d | c |
d | d | 7
d |14 d | 8
d | d | 9
d | d | 10
d | d |
d | d | 11
e |15 d | 12
e |16 d | 13
e |17 d |
e | d |
e |18 d |
e | d | 14
e | d |
f |19 d |
f |20 d |
f |21 d |
f |22 e | 15
f | e | 16
f |24 e | 17
f |25 e |
f |26 e | 18
f | e |
f | e |
f | f | 19
f |27 f | 20
f | f | 21
f | f | 22
f | f |
f | f | 24
f | 25
f | 26
f |
f |
f |
f | 27
f |
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
d | 8 d | 8
d |10 d | 10
d | d |
d |12 d | 12
d | d |
d | d |
d | d |
e |15 e | 15
e |16 e | 16
e | e |
e | e |
f |19 f | 19
f |20 f | 20
f |21 f | 21
f | f |
f |24 f | 24
f | f |
f | 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 |
d | |hi kristin d | | hi kristin
d |fumble | d | fumble |
d | |hi avi d | | hi avi
d | | 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
e |hi elisa e | hi elisa
f |hi claire f | hi claire
f |hi mike f | hi mike
f |hi marcel f | hi marcel
f |hi keith f | hi keith
f |hi marc f | hi marc
f |hi allison f | hi allison
f |hi jeff 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))
f | | |-11|((1111111,3333333),(2222222,4444444)) f | | | -11 | ((1111111,3333333),(2222222,4444444))
f |27| | | f | 27 | | |
f | | |-12| f | | | -12 |
f | | | |((11111111,33333333),(22222222,44444444)) 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...
sum SELECT sum(a) FROM a_star*;
--- 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
d | 84 d | 84
e | 66 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 |
c | c |
c | c |
d | d |
d | d |
d | d |
d | d |
d | d |
d | d |
d | d |
d | d |
e | e |
e | e |
e | e |
f | f |
f | f |
f | f |
f | f |
f | f |
f | f |
f | 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
b | 4 b | 4
c | 5 c | 5
c | 6 c | 6
d | 7 d | 7
d | 8 d | 8
d | 9 d | 9
d |10 d | 10
d |11 d | 11
d |12 d | 12
d |13 d | 13
d |14 d | 14
e |15 e | 15
e |16 e | 16
e |17 e | 17
e |18 e | 18
f |19 f | 19
f |20 f | 20
f |21 f | 21
f |22 f | 22
f |24 f | 24
f |25 f | 25
f |26 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;
class|aa|cc | ee|e SELECT * FROM e_star*;
-----+--+-----------+---+- class | aa | cc | ee | e
e |15|hi carol | -1| -------+----+-------------+-----+---
e |16|hi bob | | e | 15 | hi carol | -1 |
e |17| | -2| e | 16 | hi bob | |
e | |hi michelle| -3| e | 17 | | -2 |
e |18| | | e | | hi michelle | -3 |
e | |hi elisa | | e | 18 | | |
e | | | -4| e | | hi elisa | |
f |19|hi claire | -5| e | | | -4 |
f |20|hi mike | -6| f | 19 | hi claire | -5 |
f |21|hi marcel | | f | 20 | hi mike | -6 |
f |22| | -7| f | 21 | hi marcel | |
f | |hi keith | -8| f | 22 | | -7 |
f |24|hi marc | | f | | hi keith | -8 |
f |25| | -9| f | 24 | hi marc | |
f |26| | | f | 25 | | -9 |
f | |hi allison |-10| f | 26 | | |
f | |hi jeff | | f | | hi allison | -10 |
f | | |-11| f | | hi jeff | |
f |27| | | f | | | -11 |
f | |hi carl | | f | 27 | | |
f | | |-12| f | | hi carl | |
f | | | | f | | | -12 |
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*
class|aa|a -- SET a = text 'gazpacho'
-----+--+- -- WHERE aa > 4;
a | 1| SELECT class, aa, a FROM a_star*;
a | 2| class | aa | a
a | | -------+----+---
b | 3| a | 1 |
b | 4| a | 2 |
b | | a | |
b | | b | 3 |
c | 5| b | 4 |
c | 6| b | |
c | | b | |
c | | c | 5 |
d | 7| c | 6 |
d | 8| c | |
d | 9| c | |
d |10| d | 7 |
d | | d | 8 |
d |11| d | 9 |
d |12| d | 10 |
d |13| d | |
d | | d | 11 |
d | | d | 12 |
d | | d | 13 |
d |14| d | |
d | | d | |
d | | d | |
d | | d | 14 |
d | | d | |
e |15| d | |
e |16| d | |
e |17| d | |
e | | e | 15 |
e |18| e | 16 |
e | | e | 17 |
e | | e | |
f |19| e | 18 |
f |20| e | |
f |21| e | |
f |22| f | 19 |
f | | f | 20 |
f |24| f | 21 |
f |25| f | 22 |
f |26| f | |
f | | f | 24 |
f | | f | 25 |
f | | f | 26 |
f |27| f | |
f | | f | |
f | | f | |
f | | f | 27 |
f | | f | |
f | |
f | |
f | |
(50 rows) (50 rows)
QUERY: SELECT p.name, p.hobbies.name FROM person p; --
name |name -- versions
-----+----------- --
mike |posthacking --
joe |basketball -- postquel functions
sally|basketball --
--
-- 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
-------+-------------
mike | posthacking
joe | basketball
sally | basketball
(3 rows) (3 rows)
QUERY: SELECT p.name, p.hobbies.name FROM person* p; --
name |name -- as above, but jeff also does post_hacking.
-----+----------- --
mike |posthacking SELECT p.name, p.hobbies.name FROM person* p;
joe |basketball name | name
sally|basketball -------+-------------
jeff |posthacking mike | posthacking
joe | basketball
sally | basketball
jeff | posthacking
(4 rows) (4 rows)
QUERY: SELECT DISTINCT hobbies_r.name, hobbies_r.equipment.name FROM hobbies_r; --
name |name -- the next two queries demonstrate how functions generate bogus duplicates.
-----------+------------- -- this is a "feature" ..
basketball |hightops --
posthacking|advil SELECT DISTINCT hobbies_r.name, hobbies_r.equipment.name FROM hobbies_r;
posthacking|peet's coffee name | name
skywalking |guts -------------+---------------
basketball | hightops
posthacking | advil
posthacking | peet's coffee
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
posthacking|peet's coffee posthacking | peet's coffee
basketball |hightops basketball | hightops
basketball |hightops basketball | hightops
skywalking |guts skywalking | guts
(7 rows) (7 rows)
QUERY: SELECT p.name, p.hobbies.name, p.hobbies.equipment.name FROM person p; --
name |name |name -- mike needs advil and peet's coffee,
-----+-----------+------------- -- joe and sally need hightops, and
mike |posthacking|advil -- everyone else is fine.
mike |posthacking|peet's coffee --
joe |basketball |hightops SELECT p.name, p.hobbies.name, p.hobbies.equipment.name FROM person p;
sally|basketball |hightops name | name | name
-------+-------------+---------------
mike | posthacking | advil
mike | posthacking | peet's coffee
joe | basketball | hightops
sally | basketball | hightops
(4 rows) (4 rows)
QUERY: SELECT p.name, p.hobbies.name, p.hobbies.equipment.name FROM person* p; --
name |name |name -- as above, but jeff needs advil and peet's coffee as well.
-----+-----------+------------- --
mike |posthacking|advil SELECT p.name, p.hobbies.name, p.hobbies.equipment.name FROM person* p;
mike |posthacking|peet's coffee name | name | name
joe |basketball |hightops -------+-------------+---------------
sally|basketball |hightops mike | posthacking | advil
jeff |posthacking|advil mike | posthacking | peet's coffee
jeff |posthacking|peet's coffee joe | basketball | hightops
sally | basketball | hightops
jeff | posthacking | advil
jeff | posthacking | peet's coffee
(6 rows) (6 rows)
QUERY: SELECT p.hobbies.equipment.name, p.name, p.hobbies.name FROM person p; --
name |name |name -- just like the last two, but make sure that the target list fixup and
-------------+-----+----------- -- unflattening is being done correctly.
advil |mike |posthacking --
peet's coffee|mike |posthacking SELECT p.hobbies.equipment.name, p.name, p.hobbies.name FROM person p;
hightops |joe |basketball name | name | name
hightops |sally|basketball ---------------+-------+-------------
advil | mike | posthacking
peet's coffee | mike | posthacking
hightops | joe | 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
hightops |sally|basketball hightops | sally | basketball
advil |jeff |posthacking 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
hightops |basketball |sally hightops | basketball | sally
advil |posthacking|jeff 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
arrtest arrtest
b_star b_star
box_tbl box_tbl
bprime bprime
bt_f8_heap bt_f8_heap
bt_i4_heap bt_i4_heap
bt_name_heap bt_name_heap
bt_txt_heap bt_txt_heap
c_star c_star
char_tbl char_tbl
check2_tbl check2_tbl
check_seq check_seq
check_tbl check_tbl
circle_tbl circle_tbl
city city
copy_tbl copy_tbl
d_star d_star
datetime_tbl datetime_tbl
default_seq default_seq
default_tbl default_tbl
defaultexpr_tbl defaultexpr_tbl
dept dept
e_star e_star
emp emp
equipment_r equipment_r
f_star f_star
fast_emp4000 fast_emp4000
float4_tbl float4_tbl
float8_tbl float8_tbl
hash_f8_heap hash_f8_heap
hash_i4_heap hash_i4_heap
hash_name_heap hash_name_heap
hash_txt_heap hash_txt_heap
hobbies_r hobbies_r
iexit iexit
ihighway ihighway
inet_tbl inet_tbl
insert_seq insert_seq
insert_tbl insert_tbl
int2_tbl int2_tbl
int4_tbl int4_tbl
int8_tbl int8_tbl
iportaltest iportaltest
lseg_tbl join3_tbl
onek join4_tbl
onek2 lseg_tbl
path_tbl num_data
person num_exp_add
point_tbl num_exp_div
polygon_tbl num_exp_ln
ramp num_exp_log10
random_tbl num_exp_mul
real_city num_exp_power_10_ln
reltime_tbl num_exp_sqrt
road num_exp_sub
shighway num_result
slow_emp4000 onek
street onek2
stud_emp path_tbl
student person
subselect_tbl point_tbl
tenk1 polygon_tbl
tenk2 ramp
text_tbl random_tbl
timespan_tbl real_city
tinterval_tbl reltime_tbl
toyemp road
varchar_tbl shighway
xacttest slow_emp4000
(72 rows) street
stud_emp
student
subselect_tbl
tenk1
tenk2
text_tbl
timespan_tbl
tinterval_tbl
toyemp
varchar_tbl
xacttest
(84 rows)
--SELECT name(equipment(hobby_construct(text 'skywalking', text 'mer'))) AS equip_name;
--
-- functional joins
--
--
-- instance rules
--
--
-- rewrite rules
--
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