1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-30 11:03:19 +03:00

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

which is broken in some weird way that I don't understand.  I think it
may be exposing a bug in the new psql --- for one thing, I get different
results when I run psql by hand than the regress script gets.  What
the heck???
This commit is contained in:
Tom Lane
2000-01-09 03:48:39 +00:00
parent 0e821fb771
commit 260b6afc79
13 changed files with 4284 additions and 3850 deletions

View File

@ -1,132 +1,135 @@
QUERY: SELECT avg(four) AS avg_1 FROM onek; --
avg_1 -- AGGREGATES
----- --
1 SELECT avg(four) AS avg_1 FROM onek;
(1 row) avg_1
QUERY: SELECT avg(a) AS avg_32 FROM aggtest WHERE a < 100;
avg_32
------
32
(1 row)
QUERY: SELECT avg(b) AS avg_107_943 FROM aggtest;
avg_107_943
-----------
107.943
(1 row)
QUERY: SELECT avg(gpa) AS avg_3_4 FROM student;
avg_3_4
------- -------
3.4 1
(1 row) (1 row)
QUERY: SELECT sum(four) AS sum_1500 FROM onek; SELECT avg(a) AS avg_32 FROM aggtest WHERE a < 100;
sum_1500 avg_32
-------- --------
1500 32
(1 row) (1 row)
QUERY: SELECT sum(a) AS sum_198 FROM aggtest; SELECT avg(b) AS avg_107_943 FROM aggtest;
sum_198 avg_107_943
------- -------------
198 107.943
(1 row) (1 row)
QUERY: SELECT sum(b) AS avg_431_773 FROM aggtest; SELECT avg(gpa) AS avg_3_4 FROM student;
avg_431_773 avg_3_4
----------- ---------
431.773 3.4
(1 row) (1 row)
QUERY: SELECT sum(gpa) AS avg_6_8 FROM student; SELECT sum(four) AS sum_1500 FROM onek;
avg_6_8 sum_1500
-------
6.8
(1 row)
QUERY: SELECT max(four) AS max_3 FROM onek;
max_3
-----
3
(1 row)
QUERY: SELECT max(a) AS max_100 FROM aggtest;
max_100
-------
100
(1 row)
QUERY: SELECT max(aggtest.b) AS max_324_78 FROM aggtest;
max_324_78
---------- ----------
324.78 1500
(1 row) (1 row)
QUERY: SELECT max(student.gpa) AS max_3_7 FROM student; SELECT sum(a) AS sum_198 FROM aggtest;
max_3_7 sum_198
---------
198
(1 row)
SELECT sum(b) AS avg_431_773 FROM aggtest;
avg_431_773
-------------
431.773
(1 row)
SELECT sum(gpa) AS avg_6_8 FROM student;
avg_6_8
---------
6.8
(1 row)
SELECT max(four) AS max_3 FROM onek;
max_3
------- -------
3.7 3
(1 row) (1 row)
QUERY: SELECT count(four) AS cnt_1000 FROM onek; SELECT max(a) AS max_100 FROM aggtest;
cnt_1000 max_100
-------- ---------
1000 100
(1 row) (1 row)
QUERY: SELECT count(DISTINCT four) AS cnt_4 FROM onek; SELECT max(aggtest.b) AS max_324_78 FROM aggtest;
cnt_4 max_324_78
----- ------------
4 324.78
(1 row) (1 row)
QUERY: select ten, count(*), sum(four) from onek group by ten; SELECT max(student.gpa) AS max_3_7 FROM student;
ten|count|sum max_3_7
---+-----+--- ---------
0| 100|100 3.7
1| 100|200 (1 row)
2| 100|100
3| 100|200 SELECT count(four) AS cnt_1000 FROM onek;
4| 100|100 cnt_1000
5| 100|200 ----------
6| 100|100 1000
7| 100|200 (1 row)
8| 100|100
9| 100|200 SELECT count(DISTINCT four) AS cnt_4 FROM onek;
cnt_4
-------
4
(1 row)
select ten, count(*), sum(four) from onek group by ten;
ten | count | sum
-----+-------+-----
0 | 100 | 100
1 | 100 | 200
2 | 100 | 100
3 | 100 | 200
4 | 100 | 100
5 | 100 | 200
6 | 100 | 100
7 | 100 | 200
8 | 100 | 100
9 | 100 | 200
(10 rows) (10 rows)
QUERY: select ten, count(four), sum(DISTINCT four) from onek group by ten; select ten, count(four), sum(DISTINCT four) from onek group by ten;
ten|count|sum ten | count | sum
---+-----+--- -----+-------+-----
0| 100| 2 0 | 100 | 2
1| 100| 4 1 | 100 | 4
2| 100| 2 2 | 100 | 2
3| 100| 4 3 | 100 | 4
4| 100| 2 4 | 100 | 2
5| 100| 4 5 | 100 | 4
6| 100| 2 6 | 100 | 2
7| 100| 4 7 | 100 | 4
8| 100| 2 8 | 100 | 2
9| 100| 4 9 | 100 | 4
(10 rows) (10 rows)
QUERY: SELECT newavg(four) AS avg_1 FROM onek; SELECT newavg(four) AS avg_1 FROM onek;
avg_1 avg_1
----- -------
1 1
(1 row) (1 row)
QUERY: SELECT newsum(four) AS sum_1500 FROM onek; SELECT newsum(four) AS sum_1500 FROM onek;
sum_1500 sum_1500
-------- ----------
1500 1500
(1 row) (1 row)
QUERY: SELECT newcnt(four) AS cnt_1000 FROM onek; SELECT newcnt(four) AS cnt_1000 FROM onek;
cnt_1000 cnt_1000
-------- ----------
1000 1000
(1 row) (1 row)

View File

@ -1,253 +1,268 @@
QUERY: CREATE TABLE tmp (initial int4); --
QUERY: ALTER TABLE tmp ADD COLUMN a int4; -- ALTER_TABLE
QUERY: ALTER TABLE tmp ADD COLUMN b name; -- add attribute
QUERY: ALTER TABLE tmp ADD COLUMN c text; --
QUERY: ALTER TABLE tmp ADD COLUMN d float8; CREATE TABLE tmp (initial int4);
QUERY: ALTER TABLE tmp ADD COLUMN e float4; ALTER TABLE tmp ADD COLUMN a int4;
QUERY: ALTER TABLE tmp ADD COLUMN f int2; ALTER TABLE tmp ADD COLUMN b name;
QUERY: ALTER TABLE tmp ADD COLUMN g polygon; ALTER TABLE tmp ADD COLUMN c text;
QUERY: ALTER TABLE tmp ADD COLUMN h abstime; ALTER TABLE tmp ADD COLUMN d float8;
QUERY: ALTER TABLE tmp ADD COLUMN i char; ALTER TABLE tmp ADD COLUMN e float4;
QUERY: ALTER TABLE tmp ADD COLUMN j abstime[]; ALTER TABLE tmp ADD COLUMN f int2;
QUERY: ALTER TABLE tmp ADD COLUMN k dt; ALTER TABLE tmp ADD COLUMN g polygon;
ALTER TABLE tmp ADD COLUMN h abstime;
ALTER TABLE tmp ADD COLUMN i char;
ALTER TABLE tmp ADD COLUMN j abstime[];
ALTER TABLE tmp ADD COLUMN k dt;
ERROR: Unable to locate type name 'dt' in catalog ERROR: Unable to locate type name 'dt' in catalog
QUERY: ALTER TABLE tmp ADD COLUMN l tid; ALTER TABLE tmp ADD COLUMN l tid;
QUERY: ALTER TABLE tmp ADD COLUMN m xid; ALTER TABLE tmp ADD COLUMN m xid;
QUERY: ALTER TABLE tmp ADD COLUMN n oid8; ALTER TABLE tmp ADD COLUMN n oid8;
QUERY: ALTER TABLE tmp ADD COLUMN p smgr; --ALTER TABLE tmp ADD COLUMN o lock;
QUERY: ALTER TABLE tmp ADD COLUMN q point; ALTER TABLE tmp ADD COLUMN p smgr;
QUERY: ALTER TABLE tmp ADD COLUMN r lseg; ALTER TABLE tmp ADD COLUMN q point;
QUERY: ALTER TABLE tmp ADD COLUMN s path; ALTER TABLE tmp ADD COLUMN r lseg;
QUERY: ALTER TABLE tmp ADD COLUMN t box; ALTER TABLE tmp ADD COLUMN s path;
QUERY: ALTER TABLE tmp ADD COLUMN u tinterval; ALTER TABLE tmp ADD COLUMN t box;
QUERY: ALTER TABLE tmp ADD COLUMN v datetime; ALTER TABLE tmp ADD COLUMN u tinterval;
QUERY: ALTER TABLE tmp ADD COLUMN w timespan; ALTER TABLE tmp ADD COLUMN v datetime;
QUERY: ALTER TABLE tmp ADD COLUMN x float8[]; ALTER TABLE tmp ADD COLUMN w timespan;
QUERY: ALTER TABLE tmp ADD COLUMN y float4[]; ALTER TABLE tmp ADD COLUMN x float8[];
QUERY: ALTER TABLE tmp ADD COLUMN z int2[]; ALTER TABLE tmp ADD COLUMN y float4[];
QUERY: INSERT INTO tmp (a, b, c, d, e, f, g, h, i, j, k, l, m, n, p, q, r, s, t, u, ALTER TABLE tmp ADD COLUMN z int2[];
INSERT INTO tmp (a, b, c, d, e, f, g, h, i, j, k, l, m, n, p, q, r, s, t, u,
v, w, x, y, z) v, w, x, y, z)
VALUES (4, 'name', 'text', 4.1, 4.1, 2, '(4.1,4.1,3.1,3.1)', VALUES (4, 'name', 'text', 4.1, 4.1, 2, '(4.1,4.1,3.1,3.1)',
'Mon May 1 00:30:30 1995', 'c', '{Mon May 1 00:30:30 1995, Monday Aug 24 14:43:07 1992, epoch}', 'Mon May 1 00:30:30 1995', 'c', '{Mon May 1 00:30:30 1995, Monday Aug 24 14:43:07 1992, epoch}',
314159, '(1,1)', 512, 314159, '(1,1)', 512,
'1 2 3 4 5 6 7 8', 'magnetic disk', '(1.1,1.1)', '(4.1,4.1,3.1,3.1)', '1 2 3 4 5 6 7 8', 'magnetic disk', '(1.1,1.1)', '(4.1,4.1,3.1,3.1)',
'(0,2,4.1,4.1,3.1,3.1)', '(4.1,4.1,3.1,3.1)', '["current" "infinity"]', '(0,2,4.1,4.1,3.1,3.1)', '(4.1,4.1,3.1,3.1)', '["current" "infinity"]',
'1/3', '1,name', '{1.0,2.0,3.0,4.0}', '{1.0,2.0,3.0,4.0}', '{1,2,3,4}'); '1/3', '1,name', '{1.0,2.0,3.0,4.0}', '{1.0,2.0,3.0,4.0}', '{1,2,3,4}');
ERROR: Relation 'tmp' does not have attribute 'k' ERROR: Relation 'tmp' does not have attribute 'k'
QUERY: SELECT * FROM tmp; SELECT * FROM tmp;
initial|a|b|c|d|e|f|g|h|i|j|l|m|n|p|q|r|s|t|u|v|w|x|y|z initial | a | b | c | d | e | f | g | h | i | j | l | m | n | p | q | r | s | t | u | v | w | x | y | z
-------+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+- ---------+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---
(0 rows) (0 rows)
QUERY: DROP TABLE tmp; DROP TABLE tmp;
QUERY: CREATE TABLE tmp ( -- the wolf bug - schema mods caused inconsistent row descriptors
CREATE TABLE tmp (
initial int4 initial int4
); );
QUERY: ALTER TABLE tmp ADD COLUMN a int4; ALTER TABLE tmp ADD COLUMN a int4;
QUERY: ALTER TABLE tmp ADD COLUMN b name; ALTER TABLE tmp ADD COLUMN b name;
QUERY: ALTER TABLE tmp ADD COLUMN c text; ALTER TABLE tmp ADD COLUMN c text;
QUERY: ALTER TABLE tmp ADD COLUMN d float8; ALTER TABLE tmp ADD COLUMN d float8;
QUERY: ALTER TABLE tmp ADD COLUMN e float4; ALTER TABLE tmp ADD COLUMN e float4;
QUERY: ALTER TABLE tmp ADD COLUMN f int2; ALTER TABLE tmp ADD COLUMN f int2;
QUERY: ALTER TABLE tmp ADD COLUMN g polygon; ALTER TABLE tmp ADD COLUMN g polygon;
QUERY: ALTER TABLE tmp ADD COLUMN h abstime; ALTER TABLE tmp ADD COLUMN h abstime;
QUERY: ALTER TABLE tmp ADD COLUMN i char; ALTER TABLE tmp ADD COLUMN i char;
QUERY: ALTER TABLE tmp ADD COLUMN j abstime[]; ALTER TABLE tmp ADD COLUMN j abstime[];
QUERY: ALTER TABLE tmp ADD COLUMN k dt; ALTER TABLE tmp ADD COLUMN k dt;
ERROR: Unable to locate type name 'dt' in catalog ERROR: Unable to locate type name 'dt' in catalog
QUERY: ALTER TABLE tmp ADD COLUMN l tid; ALTER TABLE tmp ADD COLUMN l tid;
QUERY: ALTER TABLE tmp ADD COLUMN m xid; ALTER TABLE tmp ADD COLUMN m xid;
QUERY: ALTER TABLE tmp ADD COLUMN n oid8; ALTER TABLE tmp ADD COLUMN n oid8;
QUERY: ALTER TABLE tmp ADD COLUMN p smgr; --ALTER TABLE tmp ADD COLUMN o lock;
QUERY: ALTER TABLE tmp ADD COLUMN q point; ALTER TABLE tmp ADD COLUMN p smgr;
QUERY: ALTER TABLE tmp ADD COLUMN r lseg; ALTER TABLE tmp ADD COLUMN q point;
QUERY: ALTER TABLE tmp ADD COLUMN s path; ALTER TABLE tmp ADD COLUMN r lseg;
QUERY: ALTER TABLE tmp ADD COLUMN t box; ALTER TABLE tmp ADD COLUMN s path;
QUERY: ALTER TABLE tmp ADD COLUMN u tinterval; ALTER TABLE tmp ADD COLUMN t box;
QUERY: ALTER TABLE tmp ADD COLUMN v datetime; ALTER TABLE tmp ADD COLUMN u tinterval;
QUERY: ALTER TABLE tmp ADD COLUMN w timespan; ALTER TABLE tmp ADD COLUMN v datetime;
QUERY: ALTER TABLE tmp ADD COLUMN x float8[]; ALTER TABLE tmp ADD COLUMN w timespan;
QUERY: ALTER TABLE tmp ADD COLUMN y float4[]; ALTER TABLE tmp ADD COLUMN x float8[];
QUERY: ALTER TABLE tmp ADD COLUMN z int2[]; ALTER TABLE tmp ADD COLUMN y float4[];
QUERY: INSERT INTO tmp (a, b, c, d, e, f, g, h, i, j, k, l, m, n, p, q, r, s, t, u, ALTER TABLE tmp ADD COLUMN z int2[];
INSERT INTO tmp (a, b, c, d, e, f, g, h, i, j, k, l, m, n, p, q, r, s, t, u,
v, w, x, y, z) v, w, x, y, z)
VALUES (4, 'name', 'text', 4.1, 4.1, 2, '(4.1,4.1,3.1,3.1)', VALUES (4, 'name', 'text', 4.1, 4.1, 2, '(4.1,4.1,3.1,3.1)',
'Mon May 1 00:30:30 1995', 'c', '{Mon May 1 00:30:30 1995, Monday Aug 24 14:43:07 1992, epoch}', 'Mon May 1 00:30:30 1995', 'c', '{Mon May 1 00:30:30 1995, Monday Aug 24 14:43:07 1992, epoch}',
314159, '(1,1)', 512, 314159, '(1,1)', 512,
'1 2 3 4 5 6 7 8', 'magnetic disk', '(1.1,1.1)', '(4.1,4.1,3.1,3.1)', '1 2 3 4 5 6 7 8', 'magnetic disk', '(1.1,1.1)', '(4.1,4.1,3.1,3.1)',
'(0,2,4.1,4.1,3.1,3.1)', '(4.1,4.1,3.1,3.1)', '["current" "infinity"]', '(0,2,4.1,4.1,3.1,3.1)', '(4.1,4.1,3.1,3.1)', '["current" "infinity"]',
'1/3', '1,name', '{1.0,2.0,3.0,4.0}', '{1.0,2.0,3.0,4.0}', '{1,2,3,4}'); '1/3', '1,name', '{1.0,2.0,3.0,4.0}', '{1.0,2.0,3.0,4.0}', '{1,2,3,4}');
ERROR: Relation 'tmp' does not have attribute 'k' ERROR: Relation 'tmp' does not have attribute 'k'
QUERY: SELECT * FROM tmp; SELECT * FROM tmp;
initial|a|b|c|d|e|f|g|h|i|j|l|m|n|p|q|r|s|t|u|v|w|x|y|z initial | a | b | c | d | e | f | g | h | i | j | l | m | n | p | q | r | s | t | u | v | w | x | y | z
-------+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+- ---------+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---
(0 rows) (0 rows)
QUERY: DROP TABLE tmp; DROP TABLE tmp;
QUERY: ALTER TABLE tenk1 RENAME TO ten_k; --
QUERY: SELECT unique1 FROM ten_k WHERE unique1 < 20; -- rename -
unique1 -- should preserve indices
------- --
0 ALTER TABLE tenk1 RENAME TO ten_k;
1 -- 20 values, sorted
2 SELECT unique1 FROM ten_k WHERE unique1 < 20;
3 unique1
4 ---------
5 0
6 1
7 2
8 3
9 4
10 5
11 6
12 7
13 8
14 9
15 10
16 11
17 12
18 13
19 14
15
16
17
18
19
(20 rows) (20 rows)
QUERY: SELECT unique2 FROM ten_k WHERE unique2 < 20; -- 20 values, sorted
unique2 SELECT unique2 FROM ten_k WHERE unique2 < 20;
------- unique2
0 ---------
1 0
2 1
3 2
4 3
5 4
6 5
7 6
8 7
9 8
10 9
11 10
12 11
13 12
14 13
15 14
16 15
17 16
18 17
19 18
19
(20 rows) (20 rows)
QUERY: SELECT hundred FROM ten_k WHERE hundred = 50; -- 100 values, sorted
hundred SELECT hundred FROM ten_k WHERE hundred = 50;
------- hundred
50 ---------
50 50
50 50
50 50
50 50
50 50
50 50
50 50
50 50
50 50
50 50
50 50
50 50
50 50
50 50
50 50
50 50
50 50
50 50
50 50
50 50
50 50
50 50
50 50
50 50
50 50
50 50
50 50
50 50
50 50
50 50
50 50
50 50
50 50
50 50
50 50
50 50
50 50
50 50
50 50
50 50
50 50
50 50
50 50
50 50
50 50
50 50
50 50
50 50
50 50
50 50
50 50
50 50
50 50
50 50
50 50
50 50
50 50
50 50
50 50
50 50
50 50
50 50
50 50
50 50
50 50
50 50
50 50
50 50
50 50
50 50
50 50
50 50
50 50
50 50
50 50
50 50
50 50
50 50
50 50
50 50
50 50
50 50
50 50
50 50
50 50
50 50
50 50
50 50
50 50
50 50
50 50
50 50
50 50
50 50
50 50
50 50
50 50
50 50
50 50
50
(100 rows) (100 rows)
QUERY: ALTER TABLE ten_k RENAME TO tenk1; ALTER TABLE ten_k RENAME TO tenk1;
QUERY: SELECT unique1 FROM tenk1 WHERE unique1 < 5; -- 5 values, sorted
unique1 SELECT unique1 FROM tenk1 WHERE unique1 < 5;
------- unique1
0 ---------
1 0
2 1
3 2
4 3
4
(5 rows) (5 rows)

View File

@ -1,96 +1,100 @@
QUERY: SELECT b.* --
-- BTREE_INDEX
-- test retrieval of min/max keys for each index
--
SELECT b.*
FROM bt_i4_heap b FROM bt_i4_heap b
WHERE b.seqno < 1; WHERE b.seqno < 1;
seqno| random seqno | random
-----+---------- -------+------------
0|1935401906 0 | 1935401906
(1 row) (1 row)
QUERY: SELECT b.* SELECT b.*
FROM bt_i4_heap b FROM bt_i4_heap b
WHERE b.seqno >= 9999; WHERE b.seqno >= 9999;
seqno| random seqno | random
-----+---------- -------+------------
9999|1227676208 9999 | 1227676208
(1 row) (1 row)
QUERY: SELECT b.* SELECT b.*
FROM bt_i4_heap b FROM bt_i4_heap b
WHERE b.seqno = 4500; WHERE b.seqno = 4500;
seqno| random seqno | random
-----+---------- -------+------------
4500|2080851358 4500 | 2080851358
(1 row) (1 row)
QUERY: SELECT b.* SELECT b.*
FROM bt_name_heap b FROM bt_name_heap b
WHERE b.seqno < '1'::name; WHERE b.seqno < '1'::name;
seqno| random seqno | random
-----+---------- -------+------------
0|1935401906 0 | 1935401906
(1 row) (1 row)
QUERY: SELECT b.* SELECT b.*
FROM bt_name_heap b FROM bt_name_heap b
WHERE b.seqno >= '9999'::name; WHERE b.seqno >= '9999'::name;
seqno| random seqno | random
-----+---------- -------+------------
9999|1227676208 9999 | 1227676208
(1 row) (1 row)
QUERY: SELECT b.* SELECT b.*
FROM bt_name_heap b FROM bt_name_heap b
WHERE b.seqno = '4500'::name; WHERE b.seqno = '4500'::name;
seqno| random seqno | random
-----+---------- -------+------------
4500|2080851358 4500 | 2080851358
(1 row) (1 row)
QUERY: SELECT b.* SELECT b.*
FROM bt_txt_heap b FROM bt_txt_heap b
WHERE b.seqno < '1'::text; WHERE b.seqno < '1'::text;
seqno| random seqno | random
-----+---------- -------+------------
0|1935401906 0 | 1935401906
(1 row) (1 row)
QUERY: SELECT b.* SELECT b.*
FROM bt_txt_heap b FROM bt_txt_heap b
WHERE b.seqno >= '9999'::text; WHERE b.seqno >= '9999'::text;
seqno| random seqno | random
-----+---------- -------+------------
9999|1227676208 9999 | 1227676208
(1 row) (1 row)
QUERY: SELECT b.* SELECT b.*
FROM bt_txt_heap b FROM bt_txt_heap b
WHERE b.seqno = '4500'::text; WHERE b.seqno = '4500'::text;
seqno| random seqno | random
-----+---------- -------+------------
4500|2080851358 4500 | 2080851358
(1 row) (1 row)
QUERY: SELECT b.* SELECT b.*
FROM bt_f8_heap b FROM bt_f8_heap b
WHERE b.seqno < '1'::float8; WHERE b.seqno < '1'::float8;
seqno| random seqno | random
-----+---------- -------+------------
0|1935401906 0 | 1935401906
(1 row) (1 row)
QUERY: SELECT b.* SELECT b.*
FROM bt_f8_heap b FROM bt_f8_heap b
WHERE b.seqno >= '9999'::float8; WHERE b.seqno >= '9999'::float8;
seqno| random seqno | random
-----+---------- -------+------------
9999|1227676208 9999 | 1227676208
(1 row) (1 row)
QUERY: SELECT b.* SELECT b.*
FROM bt_f8_heap b FROM bt_f8_heap b
WHERE b.seqno = '4500'::float8; WHERE b.seqno = '4500'::float8;
seqno| random seqno | random
-----+---------- -------+------------
4500|2080851358 4500 | 2080851358
(1 row) (1 row)

View File

@ -1,139 +1,198 @@
QUERY: SELECT hash_i4_heap.* --
-- HASH_INDEX
-- grep 843938989 hash.data
--
SELECT hash_i4_heap.*
WHERE hash_i4_heap.random = 843938989; WHERE hash_i4_heap.random = 843938989;
seqno| random seqno | random
-----+--------- -------+-----------
15|843938989 15 | 843938989
(1 row) (1 row)
QUERY: SELECT hash_i4_heap.* --
-- hash index
-- grep 66766766 hash.data
--
SELECT hash_i4_heap.*
WHERE hash_i4_heap.random = 66766766; WHERE hash_i4_heap.random = 66766766;
seqno|random seqno | random
-----+------ -------+--------
(0 rows) (0 rows)
QUERY: SELECT hash_name_heap.* --
-- hash index
-- grep 1505703298 hash.data
--
SELECT hash_name_heap.*
WHERE hash_name_heap.random = '1505703298'::name; WHERE hash_name_heap.random = '1505703298'::name;
seqno| random seqno | random
-----+---------- -------+------------
9838|1505703298 9838 | 1505703298
(1 row) (1 row)
QUERY: SELECT hash_name_heap.* --
-- hash index
-- grep 7777777 hash.data
--
SELECT hash_name_heap.*
WHERE hash_name_heap.random = '7777777'::name; WHERE hash_name_heap.random = '7777777'::name;
seqno|random seqno | random
-----+------ -------+--------
(0 rows) (0 rows)
QUERY: SELECT hash_txt_heap.* --
-- hash index
-- grep 1351610853 hash.data
--
SELECT hash_txt_heap.*
WHERE hash_txt_heap.random = '1351610853'::text; WHERE hash_txt_heap.random = '1351610853'::text;
seqno| random seqno | random
-----+---------- -------+------------
5677|1351610853 5677 | 1351610853
(1 row) (1 row)
QUERY: SELECT hash_txt_heap.* --
-- hash index
-- grep 111111112222222233333333 hash.data
--
SELECT hash_txt_heap.*
WHERE hash_txt_heap.random = '111111112222222233333333'::text; WHERE hash_txt_heap.random = '111111112222222233333333'::text;
seqno|random seqno | random
-----+------ -------+--------
(0 rows) (0 rows)
QUERY: SELECT hash_f8_heap.* --
-- hash index
-- grep 444705537 hash.data
--
SELECT hash_f8_heap.*
WHERE hash_f8_heap.random = '444705537'::float8; WHERE hash_f8_heap.random = '444705537'::float8;
seqno| random seqno | random
-----+--------- -------+-----------
7853|444705537 7853 | 444705537
(1 row) (1 row)
QUERY: SELECT hash_f8_heap.* --
-- hash index
-- grep 88888888 hash.data
--
SELECT hash_f8_heap.*
WHERE hash_f8_heap.random = '88888888'::float8; WHERE hash_f8_heap.random = '88888888'::float8;
seqno|random seqno | random
-----+------ -------+--------
(0 rows) (0 rows)
QUERY: UPDATE hash_i4_heap --
-- hash index
-- grep '^90[^0-9]' hashovfl.data
--
-- SELECT count(*) AS i988 FROM hash_ovfl_heap
-- WHERE x = 90;
--
-- hash index
-- grep '^1000[^0-9]' hashovfl.data
--
-- SELECT count(*) AS i0 FROM hash_ovfl_heap
-- WHERE x = 1000;
--
-- HASH
--
UPDATE hash_i4_heap
SET random = 1 SET random = 1
WHERE hash_i4_heap.seqno = 1492; WHERE hash_i4_heap.seqno = 1492;
QUERY: SELECT h.seqno AS i1492, h.random AS i1 SELECT h.seqno AS i1492, h.random AS i1
FROM hash_i4_heap h FROM hash_i4_heap h
WHERE h.random = 1; WHERE h.random = 1;
i1492|i1 i1492 | i1
-----+-- -------+----
1492| 1 1492 | 1
(1 row) (1 row)
QUERY: UPDATE hash_i4_heap UPDATE hash_i4_heap
SET seqno = 20000 SET seqno = 20000
WHERE hash_i4_heap.random = 1492795354; WHERE hash_i4_heap.random = 1492795354;
QUERY: SELECT h.seqno AS i20000 SELECT h.seqno AS i20000
FROM hash_i4_heap h FROM hash_i4_heap h
WHERE h.random = 1492795354; WHERE h.random = 1492795354;
i20000 i20000
------ --------
20000 20000
(1 row) (1 row)
QUERY: UPDATE hash_name_heap UPDATE hash_name_heap
SET random = '0123456789abcdef'::name SET random = '0123456789abcdef'::name
WHERE hash_name_heap.seqno = 6543; WHERE hash_name_heap.seqno = 6543;
QUERY: SELECT h.seqno AS i6543, h.random AS c0_to_f SELECT h.seqno AS i6543, h.random AS c0_to_f
FROM hash_name_heap h FROM hash_name_heap h
WHERE h.random = '0123456789abcdef'::name; WHERE h.random = '0123456789abcdef'::name;
i6543|c0_to_f i6543 | c0_to_f
-----+---------------- -------+------------------
6543|0123456789abcdef 6543 | 0123456789abcdef
(1 row) (1 row)
QUERY: UPDATE hash_name_heap UPDATE hash_name_heap
SET seqno = 20000 SET seqno = 20000
WHERE hash_name_heap.random = '76652222'::name; WHERE hash_name_heap.random = '76652222'::name;
QUERY: SELECT h.seqno AS emptyset --
-- this is the row we just replaced; index scan should return zero rows
--
SELECT h.seqno AS emptyset
FROM hash_name_heap h FROM hash_name_heap h
WHERE h.random = '76652222'::name; WHERE h.random = '76652222'::name;
emptyset emptyset
-------- ----------
(0 rows) (0 rows)
QUERY: UPDATE hash_txt_heap UPDATE hash_txt_heap
SET random = '0123456789abcdefghijklmnop'::text SET random = '0123456789abcdefghijklmnop'::text
WHERE hash_txt_heap.seqno = 4002; WHERE hash_txt_heap.seqno = 4002;
QUERY: SELECT h.seqno AS i4002, h.random AS c0_to_p SELECT h.seqno AS i4002, h.random AS c0_to_p
FROM hash_txt_heap h FROM hash_txt_heap h
WHERE h.random = '0123456789abcdefghijklmnop'::text; WHERE h.random = '0123456789abcdefghijklmnop'::text;
i4002|c0_to_p i4002 | c0_to_p
-----+-------------------------- -------+----------------------------
4002|0123456789abcdefghijklmnop 4002 | 0123456789abcdefghijklmnop
(1 row) (1 row)
QUERY: UPDATE hash_txt_heap UPDATE hash_txt_heap
SET seqno = 20000 SET seqno = 20000
WHERE hash_txt_heap.random = '959363399'::text; WHERE hash_txt_heap.random = '959363399'::text;
QUERY: SELECT h.seqno AS t20000 SELECT h.seqno AS t20000
FROM hash_txt_heap h FROM hash_txt_heap h
WHERE h.random = '959363399'::text; WHERE h.random = '959363399'::text;
t20000 t20000
------ --------
20000 20000
(1 row) (1 row)
QUERY: UPDATE hash_f8_heap UPDATE hash_f8_heap
SET random = '-1234.1234'::float8 SET random = '-1234.1234'::float8
WHERE hash_f8_heap.seqno = 8906; WHERE hash_f8_heap.seqno = 8906;
QUERY: SELECT h.seqno AS i8096, h.random AS f1234_1234 SELECT h.seqno AS i8096, h.random AS f1234_1234
FROM hash_f8_heap h FROM hash_f8_heap h
WHERE h.random = '-1234.1234'::float8; WHERE h.random = '-1234.1234'::float8;
i8096|f1234_1234 i8096 | f1234_1234
-----+---------- -------+------------
8906|-1234.1234 8906 | -1234.1234
(1 row) (1 row)
QUERY: UPDATE hash_f8_heap UPDATE hash_f8_heap
SET seqno = 20000 SET seqno = 20000
WHERE hash_f8_heap.random = '488912369'::float8; WHERE hash_f8_heap.random = '488912369'::float8;
QUERY: SELECT h.seqno AS f20000 SELECT h.seqno AS f20000
FROM hash_f8_heap h FROM hash_f8_heap h
WHERE h.random = '488912369'::float8; WHERE h.random = '488912369'::float8;
f20000 f20000
------ --------
20000 20000
(1 row) (1 row)
-- UPDATE hash_ovfl_heap
-- SET x = 1000
-- WHERE x = 90;
-- this vacuums the index as well
-- VACUUM hash_ovfl_heap;
-- SELECT count(*) AS i0 FROM hash_ovfl_heap
-- WHERE x = 90;
-- SELECT count(*) AS i988 FROM hash_ovfl_heap
-- WHERE x = 1000;

View File

@ -1,94 +1,152 @@
QUERY: CREATE TABLE JOIN_TBL ( --
-- JOIN
-- Test join clauses
--
CREATE TABLE JOIN1_TBL (
i integer, i integer,
j integer, j integer,
x text t text
); );
QUERY: CREATE TABLE JOIN2_TBL ( CREATE TABLE JOIN2_TBL (
i integer, i integer,
k integer k integer
); );
QUERY: INSERT INTO JOIN_TBL VALUES (1, 3, 'one'); CREATE TABLE JOIN3_TBL (
QUERY: INSERT INTO JOIN_TBL VALUES (2, 2, 'two'); i integer,
QUERY: INSERT INTO JOIN_TBL VALUES (3, 1, 'three'); j integer,
QUERY: INSERT INTO JOIN_TBL VALUES (4, 0, 'four'); y integer
QUERY: INSERT INTO JOIN2_TBL VALUES (1, -1); );
QUERY: INSERT INTO JOIN2_TBL VALUES (2, 2); CREATE TABLE JOIN4_TBL (
QUERY: INSERT INTO JOIN2_TBL VALUES (3, -3); k integer,
QUERY: INSERT INTO JOIN2_TBL VALUES (2, 4); z integer
QUERY: SELECT '' AS "xxx", * );
FROM JOIN_TBL CROSS JOIN JOIN2_TBL; INSERT INTO JOIN1_TBL VALUES (1, 3, 'one');
xxx|i|j|x |i| k INSERT INTO JOIN1_TBL VALUES (2, 2, 'two');
---+-+-+-----+-+-- INSERT INTO JOIN1_TBL VALUES (3, 1, 'three');
|1|3|one |1|-1 INSERT INTO JOIN1_TBL VALUES (4, 0, 'four');
|2|2|two |1|-1 INSERT INTO JOIN2_TBL VALUES (1, -1);
|3|1|three|1|-1 INSERT INTO JOIN2_TBL VALUES (2, 2);
|4|0|four |1|-1 INSERT INTO JOIN2_TBL VALUES (3, -3);
|1|3|one |2| 2 INSERT INTO JOIN2_TBL VALUES (2, 4);
|2|2|two |2| 2 --
|3|1|three|2| 2 -- CROSS JOIN
|4|0|four |2| 2 -- Qualifications are not allowed on cross joins,
|1|3|one |3|-3 -- which degenerate into a standard unqualified inner join.
|2|2|two |3|-3 --
|3|1|three|3|-3 SELECT '' AS "xxx", *
|4|0|four |3|-3 FROM JOIN1_TBL CROSS JOIN JOIN2_TBL;
|1|3|one |2| 4 xxx | i | j | t | i | k
|2|2|two |2| 4 -----+---+---+-------+---+----
|3|1|three|2| 4 | 1 | 3 | one | 1 | -1
|4|0|four |2| 4 | 2 | 2 | two | 1 | -1
| 3 | 1 | three | 1 | -1
| 4 | 0 | four | 1 | -1
| 1 | 3 | one | 2 | 2
| 2 | 2 | two | 2 | 2
| 3 | 1 | three | 2 | 2
| 4 | 0 | four | 2 | 2
| 1 | 3 | one | 3 | -3
| 2 | 2 | two | 3 | -3
| 3 | 1 | three | 3 | -3
| 4 | 0 | four | 3 | -3
| 1 | 3 | one | 2 | 4
| 2 | 2 | two | 2 | 4
| 3 | 1 | three | 2 | 4
| 4 | 0 | four | 2 | 4
(16 rows) (16 rows)
QUERY: SELECT '' AS "xxx", * SELECT '' AS "xxx", i, k, t
FROM JOIN_TBL NATURAL JOIN JOIN2_TBL; FROM JOIN1_TBL CROSS JOIN JOIN2_TBL;
ERROR: Column 'i' is ambiguous
SELECT '' AS "xxx", ii, tt, kk
FROM JOIN1_TBL CROSS JOIN JOIN2_TBL AS JT (ii, jj, tt, ii2, kk);
ERROR: parser: parse error at or near "("
SELECT '' AS "xxx", jt.ii, jt.jj, jt.kk
FROM JOIN1_TBL CROSS JOIN JOIN2_TBL AS JT (ii, jj, tt, ii2, kk);
ERROR: parser: parse error at or near "("
--
--
-- Inner joins (equi-joins)
--
--
--
-- Inner joins (equi-joins) with USING clause
-- The USING syntax changes the shape of the resulting table
-- by including a column in the USING clause only once in the result.
--
-- Inner equi-join on all columns with the same name
SELECT '' AS "xxx", *
FROM JOIN1_TBL NATURAL JOIN JOIN2_TBL;
ERROR: JOIN expressions are not yet implemented ERROR: JOIN expressions are not yet implemented
QUERY: SELECT '' AS "xxx", * -- Inner equi-join on specified column
FROM JOIN_TBL INNER JOIN JOIN2_TBL USING (i); SELECT '' AS "xxx", *
FROM JOIN1_TBL INNER JOIN JOIN2_TBL USING (i);
ERROR: JOIN expressions are not yet implemented ERROR: JOIN expressions are not yet implemented
QUERY: SELECT '' AS "xxx", * -- Same as above, slightly different syntax
FROM JOIN_TBL JOIN JOIN2_TBL ON (JOIN_TBL.i = JOIN2_TBL.i); SELECT '' AS "xxx", *
FROM JOIN1_TBL JOIN JOIN2_TBL USING (i);
ERROR: JOIN expressions are not yet implemented ERROR: JOIN expressions are not yet implemented
QUERY: SELECT '' AS "xxx", * --
FROM JOIN_TBL JOIN JOIN2_TBL ON (JOIN_TBL.i = JOIN2_TBL.k); -- Inner joins (equi-joins)
--
SELECT '' AS "xxx", *
FROM JOIN1_TBL JOIN JOIN2_TBL ON (JOIN1_TBL.i = JOIN2_TBL.i);
ERROR: JOIN expressions are not yet implemented ERROR: JOIN expressions are not yet implemented
QUERY: SELECT '' AS "xxx", * SELECT '' AS "xxx", *
FROM JOIN_TBL CROSS JOIN JOIN2_TBL; FROM JOIN1_TBL JOIN JOIN2_TBL ON (JOIN1_TBL.i = JOIN2_TBL.k);
xxx|i|j|x |i| k ERROR: JOIN expressions are not yet implemented
---+-+-+-----+-+-- SELECT '' AS "xxx", *
|1|3|one |1|-1 FROM JOIN1_TBL CROSS JOIN JOIN2_TBL;
|2|2|two |1|-1 xxx | i | j | t | i | k
|3|1|three|1|-1 -----+---+---+-------+---+----
|4|0|four |1|-1 | 1 | 3 | one | 1 | -1
|1|3|one |2| 2 | 2 | 2 | two | 1 | -1
|2|2|two |2| 2 | 3 | 1 | three | 1 | -1
|3|1|three|2| 2 | 4 | 0 | four | 1 | -1
|4|0|four |2| 2 | 1 | 3 | one | 2 | 2
|1|3|one |3|-3 | 2 | 2 | two | 2 | 2
|2|2|two |3|-3 | 3 | 1 | three | 2 | 2
|3|1|three|3|-3 | 4 | 0 | four | 2 | 2
|4|0|four |3|-3 | 1 | 3 | one | 3 | -3
|1|3|one |2| 4 | 2 | 2 | two | 3 | -3
|2|2|two |2| 4 | 3 | 1 | three | 3 | -3
|3|1|three|2| 4 | 4 | 0 | four | 3 | -3
|4|0|four |2| 4 | 1 | 3 | one | 2 | 4
| 2 | 2 | two | 2 | 4
| 3 | 1 | three | 2 | 4
| 4 | 0 | four | 2 | 4
(16 rows) (16 rows)
QUERY: SELECT '' AS "xxx", * --
FROM JOIN_TBL JOIN JOIN2_TBL ON (JOIN_TBL.i <= JOIN2_TBL.k); -- Non-equi-joins
--
SELECT '' AS "xxx", *
FROM JOIN1_TBL JOIN JOIN2_TBL ON (JOIN1_TBL.i <= JOIN2_TBL.k);
ERROR: JOIN expressions are not yet implemented ERROR: JOIN expressions are not yet implemented
QUERY: SELECT '' AS "xxx", * --
FROM JOIN_TBL OUTER JOIN JOIN2_TBL USING (i); -- Outer joins
--
SELECT '' AS "xxx", *
NOTICE: OUTER JOIN not yet implemented NOTICE: OUTER JOIN not yet implemented
FROM JOIN1_TBL OUTER JOIN JOIN2_TBL USING (i);
ERROR: JOIN expressions are not yet implemented ERROR: JOIN expressions are not yet implemented
QUERY: SELECT '' AS "xxx", * SELECT '' AS "xxx", *
FROM JOIN_TBL LEFT OUTER JOIN JOIN2_TBL USING (i);
NOTICE: LEFT OUTER JOIN not yet implemented NOTICE: LEFT OUTER JOIN not yet implemented
FROM JOIN1_TBL LEFT OUTER JOIN JOIN2_TBL USING (i);
ERROR: JOIN expressions are not yet implemented ERROR: JOIN expressions are not yet implemented
QUERY: SELECT '' AS "xxx", * SELECT '' AS "xxx", *
FROM JOIN_TBL RIGHT OUTER JOIN JOIN2_TBL USING (i);
NOTICE: RIGHT OUTER JOIN not yet implemented NOTICE: RIGHT OUTER JOIN not yet implemented
FROM JOIN1_TBL RIGHT OUTER JOIN JOIN2_TBL USING (i);
ERROR: JOIN expressions are not yet implemented ERROR: JOIN expressions are not yet implemented
QUERY: SELECT '' AS "xxx", * SELECT '' AS "xxx", *
FROM JOIN_TBL FULL OUTER JOIN JOIN2_TBL USING (i);
NOTICE: FULL OUTER JOIN not yet implemented NOTICE: FULL OUTER JOIN not yet implemented
FROM JOIN1_TBL FULL OUTER JOIN JOIN2_TBL USING (i);
ERROR: JOIN expressions are not yet implemented ERROR: JOIN expressions are not yet implemented
QUERY: DROP TABLE JOIN_TBL; --
QUERY: DROP TABLE JOIN2_TBL; -- More complicated constructs
--
--
-- Clean up
--
DROP TABLE JOIN1_TBL;
DROP TABLE JOIN2_TBL;

View File

@ -1,106 +1,110 @@
QUERY: SELECT ''::text AS two, unique1, unique2, stringu1 --
FROM onek WHERE unique1 > 50 -- LIMIT
-- Check the LIMIT/OFFSET feature of SELECT
--
SELECT ''::text AS two, unique1, unique2, stringu1
FROM onek WHERE unique1 > 50
ORDER BY unique1 LIMIT 2; ORDER BY unique1 LIMIT 2;
two|unique1|unique2|stringu1 two | unique1 | unique2 | stringu1
---+-------+-------+-------- -----+---------+---------+----------
| 51| 76|ZBAAAA | 51 | 76 | ZBAAAA
| 52| 985|ACAAAA | 52 | 985 | ACAAAA
(2 rows) (2 rows)
QUERY: SELECT ''::text AS five, unique1, unique2, stringu1 SELECT ''::text AS five, unique1, unique2, stringu1
FROM onek WHERE unique1 > 60 FROM onek WHERE unique1 > 60
ORDER BY unique1 LIMIT 5; ORDER BY unique1 LIMIT 5;
five|unique1|unique2|stringu1 five | unique1 | unique2 | stringu1
----+-------+-------+-------- ------+---------+---------+----------
| 61| 560|JCAAAA | 61 | 560 | JCAAAA
| 62| 633|KCAAAA | 62 | 633 | KCAAAA
| 63| 296|LCAAAA | 63 | 296 | LCAAAA
| 64| 479|MCAAAA | 64 | 479 | MCAAAA
| 65| 64|NCAAAA | 65 | 64 | NCAAAA
(5 rows) (5 rows)
QUERY: SELECT ''::text AS two, unique1, unique2, stringu1 SELECT ''::text AS two, unique1, unique2, stringu1
FROM onek WHERE unique1 > 60 AND unique1 < 63 FROM onek WHERE unique1 > 60 AND unique1 < 63
ORDER BY unique1 LIMIT 5; ORDER BY unique1 LIMIT 5;
two|unique1|unique2|stringu1 two | unique1 | unique2 | stringu1
---+-------+-------+-------- -----+---------+---------+----------
| 61| 560|JCAAAA | 61 | 560 | JCAAAA
| 62| 633|KCAAAA | 62 | 633 | KCAAAA
(2 rows) (2 rows)
QUERY: SELECT ''::text AS three, unique1, unique2, stringu1 SELECT ''::text AS three, unique1, unique2, stringu1
FROM onek WHERE unique1 > 100 FROM onek WHERE unique1 > 100
ORDER BY unique1 LIMIT 3 OFFSET 20; ORDER BY unique1 LIMIT 3 OFFSET 20;
three|unique1|unique2|stringu1 three | unique1 | unique2 | stringu1
-----+-------+-------+-------- -------+---------+---------+----------
| 121| 700|REAAAA | 121 | 700 | REAAAA
| 122| 519|SEAAAA | 122 | 519 | SEAAAA
| 123| 777|TEAAAA | 123 | 777 | TEAAAA
(3 rows) (3 rows)
QUERY: SELECT ''::text AS zero, unique1, unique2, stringu1 SELECT ''::text AS zero, unique1, unique2, stringu1
FROM onek WHERE unique1 < 50 FROM onek WHERE unique1 < 50
ORDER BY unique1 DESC LIMIT 8 OFFSET 99; ORDER BY unique1 DESC LIMIT 8 OFFSET 99;
zero|unique1|unique2|stringu1 zero | unique1 | unique2 | stringu1
----+-------+-------+-------- ------+---------+---------+----------
(0 rows) (0 rows)
QUERY: SELECT ''::text AS eleven, unique1, unique2, stringu1 SELECT ''::text AS eleven, unique1, unique2, stringu1
FROM onek WHERE unique1 < 50 FROM onek WHERE unique1 < 50
ORDER BY unique1 DESC LIMIT 20 OFFSET 39; ORDER BY unique1 DESC LIMIT 20 OFFSET 39;
eleven|unique1|unique2|stringu1 eleven | unique1 | unique2 | stringu1
------+-------+-------+-------- --------+---------+---------+----------
| 10| 520|KAAAAA | 10 | 520 | KAAAAA
| 9| 49|JAAAAA | 9 | 49 | JAAAAA
| 8| 653|IAAAAA | 8 | 653 | IAAAAA
| 7| 647|HAAAAA | 7 | 647 | HAAAAA
| 6| 978|GAAAAA | 6 | 978 | GAAAAA
| 5| 541|FAAAAA | 5 | 541 | FAAAAA
| 4| 833|EAAAAA | 4 | 833 | EAAAAA
| 3| 431|DAAAAA | 3 | 431 | DAAAAA
| 2| 326|CAAAAA | 2 | 326 | CAAAAA
| 1| 214|BAAAAA | 1 | 214 | BAAAAA
| 0| 998|AAAAAA | 0 | 998 | AAAAAA
(11 rows) (11 rows)
QUERY: SELECT ''::text AS ten, unique1, unique2, stringu1 SELECT ''::text AS ten, unique1, unique2, stringu1
FROM onek FROM onek
ORDER BY unique1 OFFSET 990; ORDER BY unique1 OFFSET 990;
ten|unique1|unique2|stringu1 ten | unique1 | unique2 | stringu1
---+-------+-------+-------- -----+---------+---------+----------
| 990| 369|CMAAAA | 990 | 369 | CMAAAA
| 991| 426|DMAAAA | 991 | 426 | DMAAAA
| 992| 363|EMAAAA | 992 | 363 | EMAAAA
| 993| 661|FMAAAA | 993 | 661 | FMAAAA
| 994| 695|GMAAAA | 994 | 695 | GMAAAA
| 995| 144|HMAAAA | 995 | 144 | HMAAAA
| 996| 258|IMAAAA | 996 | 258 | IMAAAA
| 997| 21|JMAAAA | 997 | 21 | JMAAAA
| 998| 549|KMAAAA | 998 | 549 | KMAAAA
| 999| 152|LMAAAA | 999 | 152 | LMAAAA
(10 rows) (10 rows)
QUERY: SELECT ''::text AS five, unique1, unique2, stringu1 SELECT ''::text AS five, unique1, unique2, stringu1
FROM onek FROM onek
ORDER BY unique1 OFFSET 990 LIMIT 5; ORDER BY unique1 OFFSET 990 LIMIT 5;
five|unique1|unique2|stringu1 five | unique1 | unique2 | stringu1
----+-------+-------+-------- ------+---------+---------+----------
| 990| 369|CMAAAA | 990 | 369 | CMAAAA
| 991| 426|DMAAAA | 991 | 426 | DMAAAA
| 992| 363|EMAAAA | 992 | 363 | EMAAAA
| 993| 661|FMAAAA | 993 | 661 | FMAAAA
| 994| 695|GMAAAA | 994 | 695 | GMAAAA
(5 rows) (5 rows)
QUERY: SELECT ''::text AS five, unique1, unique2, stringu1 SELECT ''::text AS five, unique1, unique2, stringu1
FROM onek FROM onek
ORDER BY unique1 LIMIT 5, 900; ORDER BY unique1 LIMIT 5, 900;
five|unique1|unique2|stringu1 five | unique1 | unique2 | stringu1
----+-------+-------+-------- ------+---------+---------+----------
| 900| 913|QIAAAA | 900 | 913 | QIAAAA
| 901| 931|RIAAAA | 901 | 931 | RIAAAA
| 902| 702|SIAAAA | 902 | 702 | SIAAAA
| 903| 641|TIAAAA | 903 | 641 | TIAAAA
| 904| 793|UIAAAA | 904 | 793 | UIAAAA
(5 rows) (5 rows)

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1,119 +1,123 @@
QUERY: BEGIN; --
QUERY: DECLARE foo13 CURSOR FOR -- PORTALS_P2
--
-- EXTEND INDEX onek2_u1_prtl WHERE onek2.unique1 <= 60;
BEGIN;
DECLARE foo13 CURSOR FOR
SELECT * FROM onek WHERE unique1 = 50; SELECT * FROM onek WHERE unique1 = 50;
QUERY: DECLARE foo14 CURSOR FOR DECLARE foo14 CURSOR FOR
SELECT * FROM onek WHERE unique1 = 51; SELECT * FROM onek WHERE unique1 = 51;
QUERY: DECLARE foo15 CURSOR FOR DECLARE foo15 CURSOR FOR
SELECT * FROM onek WHERE unique1 = 52; SELECT * FROM onek WHERE unique1 = 52;
QUERY: DECLARE foo16 CURSOR FOR DECLARE foo16 CURSOR FOR
SELECT * FROM onek WHERE unique1 = 53; SELECT * FROM onek WHERE unique1 = 53;
QUERY: DECLARE foo17 CURSOR FOR DECLARE foo17 CURSOR FOR
SELECT * FROM onek WHERE unique1 = 54; SELECT * FROM onek WHERE unique1 = 54;
QUERY: DECLARE foo18 CURSOR FOR DECLARE foo18 CURSOR FOR
SELECT * FROM onek WHERE unique1 = 55; SELECT * FROM onek WHERE unique1 = 55;
QUERY: DECLARE foo19 CURSOR FOR DECLARE foo19 CURSOR FOR
SELECT * FROM onek WHERE unique1 = 56; SELECT * FROM onek WHERE unique1 = 56;
QUERY: DECLARE foo20 CURSOR FOR DECLARE foo20 CURSOR FOR
SELECT * FROM onek WHERE unique1 = 57; SELECT * FROM onek WHERE unique1 = 57;
QUERY: DECLARE foo21 CURSOR FOR DECLARE foo21 CURSOR FOR
SELECT * FROM onek WHERE unique1 = 58; SELECT * FROM onek WHERE unique1 = 58;
QUERY: DECLARE foo22 CURSOR FOR DECLARE foo22 CURSOR FOR
SELECT * FROM onek WHERE unique1 = 59; SELECT * FROM onek WHERE unique1 = 59;
QUERY: DECLARE foo23 CURSOR FOR DECLARE foo23 CURSOR FOR
SELECT * FROM onek WHERE unique1 = 60; SELECT * FROM onek WHERE unique1 = 60;
QUERY: DECLARE foo24 CURSOR FOR DECLARE foo24 CURSOR FOR
SELECT * FROM onek2 WHERE unique1 = 50; SELECT * FROM onek2 WHERE unique1 = 50;
QUERY: DECLARE foo25 CURSOR FOR DECLARE foo25 CURSOR FOR
SELECT * FROM onek2 WHERE unique1 = 60; SELECT * FROM onek2 WHERE unique1 = 60;
QUERY: FETCH all in foo13; FETCH all in foo13;
unique1|unique2|two|four|ten|twenty|hundred|thousand|twothousand|fivethous|tenthous|odd|even|stringu1|stringu2|string4 unique1 | unique2 | two | four | ten | twenty | hundred | thousand | twothousand | fivethous | tenthous | odd | even | stringu1 | stringu2 | string4
-------+-------+---+----+---+------+-------+--------+-----------+---------+--------+---+----+--------+--------+------- ---------+---------+-----+------+-----+--------+---------+----------+-------------+-----------+----------+-----+------+----------+----------+---------
50| 253| 0| 2| 0| 10| 0| 50| 50| 50| 50| 0| 1|YBAAAA |TJAAAA |HHHHxx 50 | 253 | 0 | 2 | 0 | 10 | 0 | 50 | 50 | 50 | 50 | 0 | 1 | YBAAAA | TJAAAA | HHHHxx
(1 row) (1 row)
QUERY: FETCH all in foo14; FETCH all in foo14;
unique1|unique2|two|four|ten|twenty|hundred|thousand|twothousand|fivethous|tenthous|odd|even|stringu1|stringu2|string4 unique1 | unique2 | two | four | ten | twenty | hundred | thousand | twothousand | fivethous | tenthous | odd | even | stringu1 | stringu2 | string4
-------+-------+---+----+---+------+-------+--------+-----------+---------+--------+---+----+--------+--------+------- ---------+---------+-----+------+-----+--------+---------+----------+-------------+-----------+----------+-----+------+----------+----------+---------
51| 76| 1| 3| 1| 11| 1| 51| 51| 51| 51| 2| 3|ZBAAAA |YCAAAA |AAAAxx 51 | 76 | 1 | 3 | 1 | 11 | 1 | 51 | 51 | 51 | 51 | 2 | 3 | ZBAAAA | YCAAAA | AAAAxx
(1 row) (1 row)
QUERY: FETCH all in foo15; FETCH all in foo15;
unique1|unique2|two|four|ten|twenty|hundred|thousand|twothousand|fivethous|tenthous|odd|even|stringu1|stringu2|string4 unique1 | unique2 | two | four | ten | twenty | hundred | thousand | twothousand | fivethous | tenthous | odd | even | stringu1 | stringu2 | string4
-------+-------+---+----+---+------+-------+--------+-----------+---------+--------+---+----+--------+--------+------- ---------+---------+-----+------+-----+--------+---------+----------+-------------+-----------+----------+-----+------+----------+----------+---------
52| 985| 0| 0| 2| 12| 2| 52| 52| 52| 52| 4| 5|ACAAAA |XLBAAA |HHHHxx 52 | 985 | 0 | 0 | 2 | 12 | 2 | 52 | 52 | 52 | 52 | 4 | 5 | ACAAAA | XLBAAA | HHHHxx
(1 row) (1 row)
QUERY: FETCH all in foo16; FETCH all in foo16;
unique1|unique2|two|four|ten|twenty|hundred|thousand|twothousand|fivethous|tenthous|odd|even|stringu1|stringu2|string4 unique1 | unique2 | two | four | ten | twenty | hundred | thousand | twothousand | fivethous | tenthous | odd | even | stringu1 | stringu2 | string4
-------+-------+---+----+---+------+-------+--------+-----------+---------+--------+---+----+--------+--------+------- ---------+---------+-----+------+-----+--------+---------+----------+-------------+-----------+----------+-----+------+----------+----------+---------
53| 196| 1| 1| 3| 13| 3| 53| 53| 53| 53| 6| 7|BCAAAA |OHAAAA |AAAAxx 53 | 196 | 1 | 1 | 3 | 13 | 3 | 53 | 53 | 53 | 53 | 6 | 7 | BCAAAA | OHAAAA | AAAAxx
(1 row) (1 row)
QUERY: FETCH all in foo17; FETCH all in foo17;
unique1|unique2|two|four|ten|twenty|hundred|thousand|twothousand|fivethous|tenthous|odd|even|stringu1|stringu2|string4 unique1 | unique2 | two | four | ten | twenty | hundred | thousand | twothousand | fivethous | tenthous | odd | even | stringu1 | stringu2 | string4
-------+-------+---+----+---+------+-------+--------+-----------+---------+--------+---+----+--------+--------+------- ---------+---------+-----+------+-----+--------+---------+----------+-------------+-----------+----------+-----+------+----------+----------+---------
54| 356| 0| 2| 4| 14| 4| 54| 54| 54| 54| 8| 9|CCAAAA |SNAAAA |AAAAxx 54 | 356 | 0 | 2 | 4 | 14 | 4 | 54 | 54 | 54 | 54 | 8 | 9 | CCAAAA | SNAAAA | AAAAxx
(1 row) (1 row)
QUERY: FETCH all in foo18; FETCH all in foo18;
unique1|unique2|two|four|ten|twenty|hundred|thousand|twothousand|fivethous|tenthous|odd|even|stringu1|stringu2|string4 unique1 | unique2 | two | four | ten | twenty | hundred | thousand | twothousand | fivethous | tenthous | odd | even | stringu1 | stringu2 | string4
-------+-------+---+----+---+------+-------+--------+-----------+---------+--------+---+----+--------+--------+------- ---------+---------+-----+------+-----+--------+---------+----------+-------------+-----------+----------+-----+------+----------+----------+---------
55| 627| 1| 3| 5| 15| 5| 55| 55| 55| 55| 10| 11|DCAAAA |DYAAAA |VVVVxx 55 | 627 | 1 | 3 | 5 | 15 | 5 | 55 | 55 | 55 | 55 | 10 | 11 | DCAAAA | DYAAAA | VVVVxx
(1 row) (1 row)
QUERY: FETCH all in foo19; FETCH all in foo19;
unique1|unique2|two|four|ten|twenty|hundred|thousand|twothousand|fivethous|tenthous|odd|even|stringu1|stringu2|string4 unique1 | unique2 | two | four | ten | twenty | hundred | thousand | twothousand | fivethous | tenthous | odd | even | stringu1 | stringu2 | string4
-------+-------+---+----+---+------+-------+--------+-----------+---------+--------+---+----+--------+--------+------- ---------+---------+-----+------+-----+--------+---------+----------+-------------+-----------+----------+-----+------+----------+----------+---------
56| 54| 0| 0| 6| 16| 6| 56| 56| 56| 56| 12| 13|ECAAAA |CCAAAA |OOOOxx 56 | 54 | 0 | 0 | 6 | 16 | 6 | 56 | 56 | 56 | 56 | 12 | 13 | ECAAAA | CCAAAA | OOOOxx
(1 row) (1 row)
QUERY: FETCH all in foo20; FETCH all in foo20;
unique1|unique2|two|four|ten|twenty|hundred|thousand|twothousand|fivethous|tenthous|odd|even|stringu1|stringu2|string4 unique1 | unique2 | two | four | ten | twenty | hundred | thousand | twothousand | fivethous | tenthous | odd | even | stringu1 | stringu2 | string4
-------+-------+---+----+---+------+-------+--------+-----------+---------+--------+---+----+--------+--------+------- ---------+---------+-----+------+-----+--------+---------+----------+-------------+-----------+----------+-----+------+----------+----------+---------
57| 942| 1| 1| 7| 17| 7| 57| 57| 57| 57| 14| 15|FCAAAA |GKBAAA |OOOOxx 57 | 942 | 1 | 1 | 7 | 17 | 7 | 57 | 57 | 57 | 57 | 14 | 15 | FCAAAA | GKBAAA | OOOOxx
(1 row) (1 row)
QUERY: FETCH all in foo21; FETCH all in foo21;
unique1|unique2|two|four|ten|twenty|hundred|thousand|twothousand|fivethous|tenthous|odd|even|stringu1|stringu2|string4 unique1 | unique2 | two | four | ten | twenty | hundred | thousand | twothousand | fivethous | tenthous | odd | even | stringu1 | stringu2 | string4
-------+-------+---+----+---+------+-------+--------+-----------+---------+--------+---+----+--------+--------+------- ---------+---------+-----+------+-----+--------+---------+----------+-------------+-----------+----------+-----+------+----------+----------+---------
58| 114| 0| 2| 8| 18| 8| 58| 58| 58| 58| 16| 17|GCAAAA |KEAAAA |OOOOxx 58 | 114 | 0 | 2 | 8 | 18 | 8 | 58 | 58 | 58 | 58 | 16 | 17 | GCAAAA | KEAAAA | OOOOxx
(1 row) (1 row)
QUERY: FETCH all in foo22; FETCH all in foo22;
unique1|unique2|two|four|ten|twenty|hundred|thousand|twothousand|fivethous|tenthous|odd|even|stringu1|stringu2|string4 unique1 | unique2 | two | four | ten | twenty | hundred | thousand | twothousand | fivethous | tenthous | odd | even | stringu1 | stringu2 | string4
-------+-------+---+----+---+------+-------+--------+-----------+---------+--------+---+----+--------+--------+------- ---------+---------+-----+------+-----+--------+---------+----------+-------------+-----------+----------+-----+------+----------+----------+---------
59| 593| 1| 3| 9| 19| 9| 59| 59| 59| 59| 18| 19|HCAAAA |VWAAAA |HHHHxx 59 | 593 | 1 | 3 | 9 | 19 | 9 | 59 | 59 | 59 | 59 | 18 | 19 | HCAAAA | VWAAAA | HHHHxx
(1 row) (1 row)
QUERY: FETCH all in foo23; FETCH all in foo23;
unique1|unique2|two|four|ten|twenty|hundred|thousand|twothousand|fivethous|tenthous|odd|even|stringu1|stringu2|string4 unique1 | unique2 | two | four | ten | twenty | hundred | thousand | twothousand | fivethous | tenthous | odd | even | stringu1 | stringu2 | string4
-------+-------+---+----+---+------+-------+--------+-----------+---------+--------+---+----+--------+--------+------- ---------+---------+-----+------+-----+--------+---------+----------+-------------+-----------+----------+-----+------+----------+----------+---------
60| 483| 0| 0| 0| 0| 0| 60| 60| 60| 60| 0| 1|ICAAAA |PSAAAA |VVVVxx 60 | 483 | 0 | 0 | 0 | 0 | 0 | 60 | 60 | 60 | 60 | 0 | 1 | ICAAAA | PSAAAA | VVVVxx
(1 row) (1 row)
QUERY: FETCH all in foo24; FETCH all in foo24;
unique1|unique2|two|four|ten|twenty|hundred|thousand|twothousand|fivethous|tenthous|odd|even|stringu1|stringu2|string4 unique1 | unique2 | two | four | ten | twenty | hundred | thousand | twothousand | fivethous | tenthous | odd | even | stringu1 | stringu2 | string4
-------+-------+---+----+---+------+-------+--------+-----------+---------+--------+---+----+--------+--------+------- ---------+---------+-----+------+-----+--------+---------+----------+-------------+-----------+----------+-----+------+----------+----------+---------
50| 253| 0| 2| 0| 10| 0| 50| 50| 50| 50| 0| 1|YBAAAA |TJAAAA |HHHHxx 50 | 253 | 0 | 2 | 0 | 10 | 0 | 50 | 50 | 50 | 50 | 0 | 1 | YBAAAA | TJAAAA | HHHHxx
(1 row) (1 row)
QUERY: FETCH all in foo25; FETCH all in foo25;
unique1|unique2|two|four|ten|twenty|hundred|thousand|twothousand|fivethous|tenthous|odd|even|stringu1|stringu2|string4 unique1 | unique2 | two | four | ten | twenty | hundred | thousand | twothousand | fivethous | tenthous | odd | even | stringu1 | stringu2 | string4
-------+-------+---+----+---+------+-------+--------+-----------+---------+--------+---+----+--------+--------+------- ---------+---------+-----+------+-----+--------+---------+----------+-------------+-----------+----------+-----+------+----------+----------+---------
60| 483| 0| 0| 0| 0| 0| 60| 60| 60| 60| 0| 1|ICAAAA |PSAAAA |VVVVxx 60 | 483 | 0 | 0 | 0 | 0 | 0 | 60 | 60 | 60 | 60 | 0 | 1 | ICAAAA | PSAAAA | VVVVxx
(1 row) (1 row)
QUERY: CLOSE foo13; CLOSE foo13;
QUERY: CLOSE foo14; CLOSE foo14;
QUERY: CLOSE foo15; CLOSE foo15;
QUERY: CLOSE foo16; CLOSE foo16;
QUERY: CLOSE foo17; CLOSE foo17;
QUERY: CLOSE foo18; CLOSE foo18;
QUERY: CLOSE foo19; CLOSE foo19;
QUERY: CLOSE foo20; CLOSE foo20;
QUERY: CLOSE foo21; CLOSE foo21;
QUERY: CLOSE foo22; CLOSE foo22;
QUERY: CLOSE foo23; CLOSE foo23;
QUERY: CLOSE foo24; CLOSE foo24;
QUERY: CLOSE foo25; CLOSE foo25;
QUERY: END; END;

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1,29 +1,37 @@
QUERY: CREATE TABLE temptest(col int); --
QUERY: CREATE INDEX i_temptest ON temptest(col); -- TEMP
QUERY: CREATE TEMP TABLE temptest(col int); -- Test temp relations and indexes
QUERY: CREATE INDEX i_temptest ON temptest(col); --
QUERY: DROP INDEX i_temptest; -- test temp table/index masking
QUERY: DROP TABLE temptest; CREATE TABLE temptest(col int);
QUERY: DROP INDEX i_temptest; CREATE INDEX i_temptest ON temptest(col);
QUERY: DROP TABLE temptest; CREATE TEMP TABLE temptest(col int);
QUERY: CREATE TABLE temptest(col int); CREATE INDEX i_temptest ON temptest(col);
QUERY: INSERT INTO temptest VALUES (1); DROP INDEX i_temptest;
QUERY: CREATE TEMP TABLE temptest(col int); DROP TABLE temptest;
QUERY: INSERT INTO temptest VALUES (2); DROP INDEX i_temptest;
QUERY: SELECT * FROM temptest; DROP TABLE temptest;
col -- test temp table selects
--- CREATE TABLE temptest(col int);
2 INSERT INTO temptest VALUES (1);
CREATE TEMP TABLE temptest(col int);
INSERT INTO temptest VALUES (2);
SELECT * FROM temptest;
col
-----
2
(1 row) (1 row)
QUERY: DROP TABLE temptest; DROP TABLE temptest;
QUERY: SELECT * FROM temptest; SELECT * FROM temptest;
col col
--- -----
1 1
(1 row) (1 row)
QUERY: DROP TABLE temptest; DROP TABLE temptest;
QUERY: CREATE TEMP TABLE temptest(col int); CREATE TEMP TABLE temptest(col int);
QUERY: SELECT * FROM temptest; -- test temp table deletion
\c regression
SELECT * FROM temptest;
ERROR: Relation 'temptest' does not exist ERROR: Relation 'temptest' does not exist

View File

@ -1,35 +1,42 @@
QUERY: BEGIN; --
QUERY: SELECT * -- TRANSACTIONS
--
BEGIN;
SELECT *
INTO TABLE xacttest INTO TABLE xacttest
FROM aggtest; FROM aggtest;
QUERY: INSERT INTO xacttest (a, b) VALUES (777, 777.777); INSERT INTO xacttest (a, b) VALUES (777, 777.777);
QUERY: END; END;
QUERY: SELECT a FROM xacttest WHERE a > 100; -- should retrieve one value--
a SELECT a FROM xacttest WHERE a > 100;
--- a
777 -----
777
(1 row) (1 row)
QUERY: BEGIN; BEGIN;
QUERY: CREATE TABLE disappear (a int4); CREATE TABLE disappear (a int4);
QUERY: DELETE FROM aggtest; DELETE FROM aggtest;
QUERY: SELECT * FROM aggtest; -- should be empty
a|b SELECT * FROM aggtest;
-+- a | b
---+---
(0 rows) (0 rows)
QUERY: ABORT; ABORT;
QUERY: SELECT oid FROM pg_class WHERE relname = 'disappear'; -- should not exist
oid SELECT oid FROM pg_class WHERE relname = 'disappear';
--- oid
-----
(0 rows) (0 rows)
QUERY: SELECT * FROM aggtest; -- should have members again
a| b SELECT * FROM aggtest;
---+------- a | b
56| 7.8 -----+---------
100| 99.097 56 | 7.8
0|0.09561 100 | 99.097
42| 324.78 0 | 0.09561
42 | 324.78
(4 rows) (4 rows)