More splits and cleanups...
This commit is contained in:
parent
063190a5fa
commit
588ae64c44
14
src/test/regress/expected/create_aggregate.out
Normal file
14
src/test/regress/expected/create_aggregate.out
Normal file
@ -0,0 +1,14 @@
|
||||
QUERY: CREATE AGGREGATE newavg (
|
||||
sfunc1 = int4pl, basetype = int4, stype1 = int4,
|
||||
sfunc2 = int4inc, stype2 = int4,
|
||||
finalfunc = int4div,
|
||||
initcond1 = '0', initcond2 = '0'
|
||||
);
|
||||
QUERY: CREATE AGGREGATE newsum (
|
||||
sfunc1 = int4pl, basetype = int4, stype1 = int4,
|
||||
initcond1 = '0'
|
||||
);
|
||||
QUERY: CREATE AGGREGATE newcnt (
|
||||
sfunc2 = int4inc, basetype = int4, stype2 = int4,
|
||||
initcond2 = '0'
|
||||
);
|
22
src/test/regress/expected/create_index.out
Normal file
22
src/test/regress/expected/create_index.out
Normal file
@ -0,0 +1,22 @@
|
||||
QUERY: CREATE INDEX onek_unique1 ON onek USING btree(unique1 int4_ops);
|
||||
QUERY: CREATE INDEX onek_unique2 ON onek USING btree(unique2 int4_ops);
|
||||
QUERY: CREATE INDEX onek_hundred ON onek USING btree(hundred int4_ops);
|
||||
QUERY: CREATE INDEX onek_stringu1 ON onek USING btree(stringu1 char16_ops);
|
||||
QUERY: CREATE INDEX tenk1_unique1 ON tenk1 USING btree(unique1 int4_ops);
|
||||
QUERY: CREATE INDEX tenk1_unique2 ON tenk1 USING btree(unique2 int4_ops);
|
||||
QUERY: CREATE INDEX tenk1_hundred ON tenk1 USING btree(hundred int4_ops);
|
||||
QUERY: CREATE INDEX tenk2_unique1 ON tenk2 USING btree(unique1 int4_ops);
|
||||
QUERY: CREATE INDEX tenk2_unique2 ON tenk2 USING btree(unique2 int4_ops);
|
||||
QUERY: CREATE INDEX tenk2_hundred ON tenk2 USING btree(hundred int4_ops);
|
||||
QUERY: CREATE INDEX rix ON road USING btree (name text_ops);
|
||||
QUERY: CREATE INDEX iix ON ihighway USING btree (name text_ops);
|
||||
QUERY: CREATE INDEX six ON shighway USING btree (name text_ops);
|
||||
QUERY: CREATE INDEX bt_i4_index ON bt_i4_heap USING btree (seqno int4_ops);
|
||||
QUERY: CREATE INDEX bt_c16_index ON bt_c16_heap USING btree (seqno char16_ops);
|
||||
QUERY: CREATE INDEX bt_txt_index ON bt_txt_heap USING btree (seqno text_ops);
|
||||
QUERY: CREATE INDEX bt_f8_index ON bt_f8_heap USING btree (seqno float8_ops);
|
||||
QUERY: CREATE INDEX rect2ind ON fast_emp4000 USING rtree (home_base bigbox_ops);
|
||||
QUERY: CREATE INDEX hash_i4_index ON hash_i4_heap USING hash (random int4_ops);
|
||||
QUERY: CREATE INDEX hash_c16_index ON hash_c16_heap USING hash (random char16_ops);
|
||||
QUERY: CREATE INDEX hash_txt_index ON hash_txt_heap USING hash (random text_ops);
|
||||
QUERY: CREATE INDEX hash_f8_index ON hash_f8_heap USING hash (random float8_ops);
|
24
src/test/regress/expected/create_operator.out
Normal file
24
src/test/regress/expected/create_operator.out
Normal file
@ -0,0 +1,24 @@
|
||||
QUERY: CREATE OPERATOR ## (
|
||||
leftarg = path,
|
||||
rightarg = path,
|
||||
procedure = path_inter,
|
||||
commutator = ##
|
||||
);
|
||||
QUERY: CREATE OPERATOR <% (
|
||||
leftarg = point,
|
||||
rightarg = circle,
|
||||
procedure = pt_in_circle,
|
||||
commutator = >=%
|
||||
);
|
||||
QUERY: CREATE OPERATOR @#@ (
|
||||
rightarg = int4,
|
||||
procedure = int4fac
|
||||
);
|
||||
QUERY: CREATE OPERATOR #@# (
|
||||
leftarg = int4,
|
||||
procedure = int4fac
|
||||
);
|
||||
QUERY: CREATE OPERATOR #%# (
|
||||
leftarg = int4,
|
||||
procedure = int4fac
|
||||
);
|
12
src/test/regress/expected/create_view.out
Normal file
12
src/test/regress/expected/create_view.out
Normal file
@ -0,0 +1,12 @@
|
||||
QUERY: CREATE VIEW street AS
|
||||
SELECT r.name, r.thepath, c.cname AS cname
|
||||
FROM road r, real_city c
|
||||
WHERE c.outline ## r.thepath;
|
||||
QUERY: CREATE VIEW iexit AS
|
||||
SELECT ih.name, ih.thepath,
|
||||
interpt_pp(ih.thepath, r.thepath) AS exit
|
||||
FROM ihighway ih, ramp r
|
||||
WHERE ih.thepath ## r.thepath;
|
||||
QUERY: CREATE VIEW toyemp AS
|
||||
SELECT name, age, location, 12*salary AS annualsal
|
||||
FROM emp;
|
3892
src/test/regress/expected/misc.out
Normal file
3892
src/test/regress/expected/misc.out
Normal file
File diff suppressed because it is too large
Load Diff
28
src/test/regress/expected/sanity_check.out
Normal file
28
src/test/regress/expected/sanity_check.out
Normal file
@ -0,0 +1,28 @@
|
||||
QUERY: VACUUM;
|
||||
QUERY: SELECT relname, relhasindex
|
||||
FROM pg_class
|
||||
WHERE relhasindex
|
||||
ORDER BY relname;
|
||||
relname |relhasindex
|
||||
-------------+-----------
|
||||
bt_c16_heap |t
|
||||
bt_f8_heap |t
|
||||
bt_i4_heap |t
|
||||
bt_txt_heap |t
|
||||
fast_emp4000 |t
|
||||
hash_c16_heap|t
|
||||
hash_f8_heap |t
|
||||
hash_i4_heap |t
|
||||
hash_txt_heap|t
|
||||
ihighway |t
|
||||
onek |t
|
||||
pg_attribute |t
|
||||
pg_class |t
|
||||
pg_proc |t
|
||||
pg_type |t
|
||||
road |t
|
||||
shighway |t
|
||||
tenk1 |t
|
||||
tenk2 |t
|
||||
(19 rows)
|
||||
|
@ -268,184 +268,3 @@ INSERT INTO iportaltest (i, d, p)
|
||||
INSERT INTO iportaltest (i, d, p)
|
||||
VALUES (2, 89.05, '(4.0,3.0,2.0,1.0)'::polygon);
|
||||
|
||||
--
|
||||
-- CREATE ancillary data structures (i.e. indices)
|
||||
--
|
||||
|
||||
--
|
||||
-- BTREE
|
||||
--
|
||||
CREATE INDEX onek_unique1 ON onek USING btree(unique1 int4_ops);
|
||||
|
||||
CREATE INDEX onek_unique2 ON onek USING btree(unique2 int4_ops);
|
||||
|
||||
CREATE INDEX onek_hundred ON onek USING btree(hundred int4_ops);
|
||||
|
||||
CREATE INDEX onek_stringu1 ON onek USING btree(stringu1 char16_ops);
|
||||
|
||||
CREATE INDEX tenk1_unique1 ON tenk1 USING btree(unique1 int4_ops);
|
||||
|
||||
CREATE INDEX tenk1_unique2 ON tenk1 USING btree(unique2 int4_ops);
|
||||
|
||||
CREATE INDEX tenk1_hundred ON tenk1 USING btree(hundred int4_ops);
|
||||
|
||||
CREATE INDEX tenk2_unique1 ON tenk2 USING btree(unique1 int4_ops);
|
||||
|
||||
CREATE INDEX tenk2_unique2 ON tenk2 USING btree(unique2 int4_ops);
|
||||
|
||||
CREATE INDEX tenk2_hundred ON tenk2 USING btree(hundred int4_ops);
|
||||
|
||||
CREATE INDEX rix ON road USING btree (name text_ops);
|
||||
|
||||
CREATE INDEX iix ON ihighway USING btree (name text_ops);
|
||||
|
||||
CREATE INDEX six ON shighway USING btree (name text_ops);
|
||||
|
||||
--
|
||||
-- BTREE ascending/descending cases
|
||||
--
|
||||
-- we load int4/text from pure descending data (each key is a new
|
||||
-- low key) and c16/f8 from pure ascending data (each key is a new
|
||||
-- high key). we had a bug where new low keys would sometimes be
|
||||
-- "lost".
|
||||
--
|
||||
CREATE INDEX bt_i4_index ON bt_i4_heap USING btree (seqno int4_ops);
|
||||
|
||||
CREATE INDEX bt_c16_index ON bt_c16_heap USING btree (seqno char16_ops);
|
||||
|
||||
CREATE INDEX bt_txt_index ON bt_txt_heap USING btree (seqno text_ops);
|
||||
|
||||
CREATE INDEX bt_f8_index ON bt_f8_heap USING btree (seqno float8_ops);
|
||||
|
||||
--
|
||||
-- BTREE partial indices
|
||||
-- partial indices are not supported in postgres95
|
||||
--
|
||||
--CREATE INDEX onek2_u1_prtl ON onek2 USING btree(unique1 int4_ops)
|
||||
-- where onek2.unique1 < 20 or onek2.unique1 > 980;
|
||||
|
||||
--CREATE INDEX onek2_u2_prtl ON onek2 USING btree(unique2 int4_ops)
|
||||
-- where onek2.stringu1 < 'B';
|
||||
|
||||
-- EXTEND INDEX onek2_u2_prtl where onek2.stringu1 < 'C';
|
||||
|
||||
-- EXTEND INDEX onek2_u2_prtl;
|
||||
|
||||
-- CREATE INDEX onek2_stu1_prtl ON onek2 USING btree(stringu1 char16_ops)
|
||||
-- where onek2.stringu1 >= 'J' and onek2.stringu1 < 'K';
|
||||
|
||||
--
|
||||
-- RTREE
|
||||
--
|
||||
-- rtrees use a quadratic page-splitting algorithm that takes a
|
||||
-- really, really long time. we don't test all rtree opclasses
|
||||
-- in the regression test (we check them USING the sequoia 2000
|
||||
-- benchmark).
|
||||
--
|
||||
CREATE INDEX rect2ind ON fast_emp4000 USING rtree (home_base bigbox_ops);
|
||||
|
||||
|
||||
--
|
||||
-- HASH
|
||||
--
|
||||
CREATE INDEX hash_i4_index ON hash_i4_heap USING hash (random int4_ops);
|
||||
|
||||
CREATE INDEX hash_c16_index ON hash_c16_heap USING hash (random char16_ops);
|
||||
|
||||
CREATE INDEX hash_txt_index ON hash_txt_heap USING hash (random text_ops);
|
||||
|
||||
CREATE INDEX hash_f8_index ON hash_f8_heap USING hash (random float8_ops);
|
||||
|
||||
-- CREATE INDEX hash_ovfl_index ON hash_ovfl_heap USING hash (x int4_ops);
|
||||
|
||||
--
|
||||
-- OPERATOR DEFINITIONS
|
||||
--
|
||||
CREATE OPERATOR ## (
|
||||
leftarg = path,
|
||||
rightarg = path,
|
||||
procedure = path_inter,
|
||||
commutator = ##
|
||||
);
|
||||
|
||||
CREATE OPERATOR <% (
|
||||
leftarg = point,
|
||||
rightarg = circle,
|
||||
procedure = pt_in_circle,
|
||||
commutator = >=%
|
||||
);
|
||||
|
||||
CREATE OPERATOR @#@ (
|
||||
rightarg = int4, -- left unary
|
||||
procedure = int4fac
|
||||
);
|
||||
|
||||
CREATE OPERATOR #@# (
|
||||
leftarg = int4, -- right unary
|
||||
procedure = int4fac
|
||||
);
|
||||
|
||||
CREATE OPERATOR #%# (
|
||||
leftarg = int4, -- right unary
|
||||
procedure = int4fac
|
||||
);
|
||||
|
||||
--
|
||||
-- VIRTUAL CLASS DEFINITIONS
|
||||
-- (this also tests the query rewrite system)
|
||||
--
|
||||
|
||||
CREATE VIEW street AS
|
||||
SELECT r.name, r.thepath, c.cname AS cname
|
||||
FROM road r, real_city c
|
||||
WHERE c.outline ## r.thepath;
|
||||
|
||||
CREATE VIEW iexit AS
|
||||
SELECT ih.name, ih.thepath,
|
||||
interpt_pp(ih.thepath, r.thepath) AS exit
|
||||
FROM ihighway ih, ramp r
|
||||
WHERE ih.thepath ## r.thepath;
|
||||
|
||||
CREATE VIEW toyemp AS
|
||||
SELECT name, age, location, 12*salary AS annualsal
|
||||
FROM emp;
|
||||
|
||||
--
|
||||
-- RULES ???
|
||||
--
|
||||
|
||||
--
|
||||
-- AGGREGATE DEFINITIONS
|
||||
--
|
||||
|
||||
-- all functions CREATEd
|
||||
CREATE AGGREGATE newavg (
|
||||
sfunc1 = int4pl, basetype = int4, stype1 = int4,
|
||||
sfunc2 = int4inc, stype2 = int4,
|
||||
finalfunc = int4div,
|
||||
initcond1 = '0', initcond2 = '0'
|
||||
);
|
||||
|
||||
-- sfunc1 (value-dependent) only
|
||||
CREATE AGGREGATE newsum (
|
||||
sfunc1 = int4pl, basetype = int4, stype1 = int4,
|
||||
initcond1 = '0'
|
||||
);
|
||||
|
||||
-- sfunc2 (value-independent) only
|
||||
CREATE AGGREGATE newcnt (
|
||||
sfunc2 = int4inc, basetype = int4, stype2 = int4,
|
||||
initcond2 = '0'
|
||||
);
|
||||
|
||||
VACUUM;
|
||||
|
||||
--
|
||||
-- sanity check, if we don't have indices the test will take years to
|
||||
-- complete.
|
||||
--
|
||||
SELECT relname, relhasindex
|
||||
FROM pg_class
|
||||
WHERE relhasindex
|
||||
ORDER BY relname;
|
||||
|
||||
|
File diff suppressed because it is too large
Load Diff
26
src/test/regress/sql/create_aggregate.sql
Normal file
26
src/test/regress/sql/create_aggregate.sql
Normal file
@ -0,0 +1,26 @@
|
||||
--
|
||||
-- AGGREGATE DEFINITIONS
|
||||
--
|
||||
|
||||
-- all functions CREATEd
|
||||
CREATE AGGREGATE newavg (
|
||||
sfunc1 = int4pl, basetype = int4, stype1 = int4,
|
||||
sfunc2 = int4inc, stype2 = int4,
|
||||
finalfunc = int4div,
|
||||
initcond1 = '0', initcond2 = '0'
|
||||
);
|
||||
|
||||
-- sfunc1 (value-dependent) only
|
||||
CREATE AGGREGATE newsum (
|
||||
sfunc1 = int4pl, basetype = int4, stype1 = int4,
|
||||
initcond1 = '0'
|
||||
);
|
||||
|
||||
-- sfunc2 (value-independent) only
|
||||
CREATE AGGREGATE newcnt (
|
||||
sfunc2 = int4inc, basetype = int4, stype2 = int4,
|
||||
initcond2 = '0'
|
||||
);
|
||||
|
||||
VACUUM;
|
||||
|
90
src/test/regress/sql/create_index.sql
Normal file
90
src/test/regress/sql/create_index.sql
Normal file
@ -0,0 +1,90 @@
|
||||
--
|
||||
-- CREATE ancillary data structures (i.e. indices)
|
||||
--
|
||||
|
||||
--
|
||||
-- BTREE
|
||||
--
|
||||
CREATE INDEX onek_unique1 ON onek USING btree(unique1 int4_ops);
|
||||
|
||||
CREATE INDEX onek_unique2 ON onek USING btree(unique2 int4_ops);
|
||||
|
||||
CREATE INDEX onek_hundred ON onek USING btree(hundred int4_ops);
|
||||
|
||||
CREATE INDEX onek_stringu1 ON onek USING btree(stringu1 char16_ops);
|
||||
|
||||
CREATE INDEX tenk1_unique1 ON tenk1 USING btree(unique1 int4_ops);
|
||||
|
||||
CREATE INDEX tenk1_unique2 ON tenk1 USING btree(unique2 int4_ops);
|
||||
|
||||
CREATE INDEX tenk1_hundred ON tenk1 USING btree(hundred int4_ops);
|
||||
|
||||
CREATE INDEX tenk2_unique1 ON tenk2 USING btree(unique1 int4_ops);
|
||||
|
||||
CREATE INDEX tenk2_unique2 ON tenk2 USING btree(unique2 int4_ops);
|
||||
|
||||
CREATE INDEX tenk2_hundred ON tenk2 USING btree(hundred int4_ops);
|
||||
|
||||
CREATE INDEX rix ON road USING btree (name text_ops);
|
||||
|
||||
CREATE INDEX iix ON ihighway USING btree (name text_ops);
|
||||
|
||||
CREATE INDEX six ON shighway USING btree (name text_ops);
|
||||
|
||||
--
|
||||
-- BTREE ascending/descending cases
|
||||
--
|
||||
-- we load int4/text from pure descending data (each key is a new
|
||||
-- low key) and c16/f8 from pure ascending data (each key is a new
|
||||
-- high key). we had a bug where new low keys would sometimes be
|
||||
-- "lost".
|
||||
--
|
||||
CREATE INDEX bt_i4_index ON bt_i4_heap USING btree (seqno int4_ops);
|
||||
|
||||
CREATE INDEX bt_c16_index ON bt_c16_heap USING btree (seqno char16_ops);
|
||||
|
||||
CREATE INDEX bt_txt_index ON bt_txt_heap USING btree (seqno text_ops);
|
||||
|
||||
CREATE INDEX bt_f8_index ON bt_f8_heap USING btree (seqno float8_ops);
|
||||
|
||||
--
|
||||
-- BTREE partial indices
|
||||
-- partial indices are not supported in postgres95
|
||||
--
|
||||
--CREATE INDEX onek2_u1_prtl ON onek2 USING btree(unique1 int4_ops)
|
||||
-- where onek2.unique1 < 20 or onek2.unique1 > 980;
|
||||
|
||||
--CREATE INDEX onek2_u2_prtl ON onek2 USING btree(unique2 int4_ops)
|
||||
-- where onek2.stringu1 < 'B';
|
||||
|
||||
-- EXTEND INDEX onek2_u2_prtl where onek2.stringu1 < 'C';
|
||||
|
||||
-- EXTEND INDEX onek2_u2_prtl;
|
||||
|
||||
-- CREATE INDEX onek2_stu1_prtl ON onek2 USING btree(stringu1 char16_ops)
|
||||
-- where onek2.stringu1 >= 'J' and onek2.stringu1 < 'K';
|
||||
|
||||
--
|
||||
-- RTREE
|
||||
--
|
||||
-- rtrees use a quadratic page-splitting algorithm that takes a
|
||||
-- really, really long time. we don't test all rtree opclasses
|
||||
-- in the regression test (we check them USING the sequoia 2000
|
||||
-- benchmark).
|
||||
--
|
||||
CREATE INDEX rect2ind ON fast_emp4000 USING rtree (home_base bigbox_ops);
|
||||
|
||||
|
||||
--
|
||||
-- HASH
|
||||
--
|
||||
CREATE INDEX hash_i4_index ON hash_i4_heap USING hash (random int4_ops);
|
||||
|
||||
CREATE INDEX hash_c16_index ON hash_c16_heap USING hash (random char16_ops);
|
||||
|
||||
CREATE INDEX hash_txt_index ON hash_txt_heap USING hash (random text_ops);
|
||||
|
||||
CREATE INDEX hash_f8_index ON hash_f8_heap USING hash (random float8_ops);
|
||||
|
||||
-- CREATE INDEX hash_ovfl_index ON hash_ovfl_heap USING hash (x int4_ops);
|
||||
|
32
src/test/regress/sql/create_operator.sql
Normal file
32
src/test/regress/sql/create_operator.sql
Normal file
@ -0,0 +1,32 @@
|
||||
--
|
||||
-- OPERATOR DEFINITIONS
|
||||
--
|
||||
CREATE OPERATOR ## (
|
||||
leftarg = path,
|
||||
rightarg = path,
|
||||
procedure = path_inter,
|
||||
commutator = ##
|
||||
);
|
||||
|
||||
CREATE OPERATOR <% (
|
||||
leftarg = point,
|
||||
rightarg = circle,
|
||||
procedure = pt_in_circle,
|
||||
commutator = >=%
|
||||
);
|
||||
|
||||
CREATE OPERATOR @#@ (
|
||||
rightarg = int4, -- left unary
|
||||
procedure = int4fac
|
||||
);
|
||||
|
||||
CREATE OPERATOR #@# (
|
||||
leftarg = int4, -- right unary
|
||||
procedure = int4fac
|
||||
);
|
||||
|
||||
CREATE OPERATOR #%# (
|
||||
leftarg = int4, -- right unary
|
||||
procedure = int4fac
|
||||
);
|
||||
|
20
src/test/regress/sql/create_view.sql
Normal file
20
src/test/regress/sql/create_view.sql
Normal file
@ -0,0 +1,20 @@
|
||||
--
|
||||
-- VIRTUAL CLASS DEFINITIONS
|
||||
-- (this also tests the query rewrite system)
|
||||
--
|
||||
|
||||
CREATE VIEW street AS
|
||||
SELECT r.name, r.thepath, c.cname AS cname
|
||||
FROM road r, real_city c
|
||||
WHERE c.outline ## r.thepath;
|
||||
|
||||
CREATE VIEW iexit AS
|
||||
SELECT ih.name, ih.thepath,
|
||||
interpt_pp(ih.thepath, r.thepath) AS exit
|
||||
FROM ihighway ih, ramp r
|
||||
WHERE ih.thepath ## r.thepath;
|
||||
|
||||
CREATE VIEW toyemp AS
|
||||
SELECT name, age, location, 12*salary AS annualsal
|
||||
FROM emp;
|
||||
|
9
src/test/regress/sql/sanity_check.sql
Normal file
9
src/test/regress/sql/sanity_check.sql
Normal file
@ -0,0 +1,9 @@
|
||||
--
|
||||
-- sanity check, if we don't have indices the test will take years to
|
||||
-- complete.
|
||||
--
|
||||
SELECT relname, relhasindex
|
||||
FROM pg_class
|
||||
WHERE relhasindex
|
||||
ORDER BY relname;
|
||||
|
@ -2,6 +2,11 @@ create_function
|
||||
create_type
|
||||
create_table
|
||||
create_misc
|
||||
create_aggregate
|
||||
create_view
|
||||
create_operator
|
||||
create_index
|
||||
sanity_check
|
||||
reltime
|
||||
abstime
|
||||
boolean
|
||||
@ -23,3 +28,4 @@ point
|
||||
polygon
|
||||
text
|
||||
tinterval
|
||||
misc
|
||||
|
Loading…
x
Reference in New Issue
Block a user