2000-01-05 18:31:08 +01:00
|
|
|
--
|
|
|
|
-- CREATE_TABLE
|
|
|
|
--
|
|
|
|
--
|
|
|
|
-- CLASS DEFINITIONS
|
|
|
|
--
|
|
|
|
CREATE TABLE hobbies_r (
|
|
|
|
name text,
|
1997-04-05 23:26:00 +02:00
|
|
|
person text
|
|
|
|
);
|
2000-01-05 18:31:08 +01:00
|
|
|
CREATE TABLE equipment_r (
|
1997-04-05 23:26:00 +02:00
|
|
|
name text,
|
|
|
|
hobby text
|
|
|
|
);
|
2000-01-05 18:31:08 +01:00
|
|
|
CREATE TABLE onek (
|
1997-04-05 23:26:00 +02:00
|
|
|
unique1 int4,
|
|
|
|
unique2 int4,
|
2000-01-05 18:31:08 +01:00
|
|
|
two int4,
|
1997-04-05 23:26:00 +02:00
|
|
|
four int4,
|
2000-01-05 18:31:08 +01:00
|
|
|
ten int4,
|
1997-04-05 23:26:00 +02:00
|
|
|
twenty int4,
|
|
|
|
hundred int4,
|
|
|
|
thousand int4,
|
|
|
|
twothousand int4,
|
|
|
|
fivethous int4,
|
|
|
|
tenthous int4,
|
2000-01-05 18:31:08 +01:00
|
|
|
odd int4,
|
1997-04-05 23:26:00 +02:00
|
|
|
even int4,
|
1998-04-26 06:12:15 +02:00
|
|
|
stringu1 name,
|
|
|
|
stringu2 name,
|
|
|
|
string4 name
|
1997-04-05 23:26:00 +02:00
|
|
|
);
|
2000-01-05 18:31:08 +01:00
|
|
|
CREATE TABLE tenk1 (
|
1997-04-05 23:26:00 +02:00
|
|
|
unique1 int4,
|
|
|
|
unique2 int4,
|
2000-01-05 18:31:08 +01:00
|
|
|
two int4,
|
1997-04-05 23:26:00 +02:00
|
|
|
four int4,
|
2000-01-05 18:31:08 +01:00
|
|
|
ten int4,
|
1997-04-05 23:26:00 +02:00
|
|
|
twenty int4,
|
|
|
|
hundred int4,
|
|
|
|
thousand int4,
|
|
|
|
twothousand int4,
|
|
|
|
fivethous int4,
|
|
|
|
tenthous int4,
|
2000-01-05 18:31:08 +01:00
|
|
|
odd int4,
|
1997-04-05 23:26:00 +02:00
|
|
|
even int4,
|
1998-04-26 06:12:15 +02:00
|
|
|
stringu1 name,
|
|
|
|
stringu2 name,
|
|
|
|
string4 name
|
1997-04-05 23:26:00 +02:00
|
|
|
);
|
2000-01-05 18:31:08 +01:00
|
|
|
CREATE TABLE tenk2 (
|
1997-04-05 23:26:00 +02:00
|
|
|
unique1 int4,
|
|
|
|
unique2 int4,
|
|
|
|
two int4,
|
|
|
|
four int4,
|
2000-01-05 18:31:08 +01:00
|
|
|
ten int4,
|
1997-04-05 23:26:00 +02:00
|
|
|
twenty int4,
|
|
|
|
hundred int4,
|
|
|
|
thousand int4,
|
2000-01-05 18:31:08 +01:00
|
|
|
twothousand int4,
|
1997-04-05 23:26:00 +02:00
|
|
|
fivethous int4,
|
|
|
|
tenthous int4,
|
2000-01-05 18:31:08 +01:00
|
|
|
odd int4,
|
1997-04-05 23:26:00 +02:00
|
|
|
even int4,
|
1998-04-26 06:12:15 +02:00
|
|
|
stringu1 name,
|
|
|
|
stringu2 name,
|
|
|
|
string4 name
|
1997-04-05 23:26:00 +02:00
|
|
|
);
|
2000-01-05 18:31:08 +01:00
|
|
|
CREATE TABLE person (
|
1997-04-05 23:26:00 +02:00
|
|
|
name text,
|
2000-01-05 18:31:08 +01:00
|
|
|
age int4,
|
1997-04-05 23:26:00 +02:00
|
|
|
location point
|
|
|
|
);
|
2000-01-05 18:31:08 +01:00
|
|
|
CREATE TABLE emp (
|
1997-04-05 23:26:00 +02:00
|
|
|
salary int4,
|
1998-04-26 06:12:15 +02:00
|
|
|
manager name
|
1997-04-05 23:26:00 +02:00
|
|
|
) INHERITS (person);
|
2000-01-05 18:31:08 +01:00
|
|
|
CREATE TABLE student (
|
1997-04-05 23:26:00 +02:00
|
|
|
gpa float8
|
|
|
|
) INHERITS (person);
|
2000-01-05 18:31:08 +01:00
|
|
|
CREATE TABLE stud_emp (
|
1997-04-05 23:26:00 +02:00
|
|
|
percent int4
|
|
|
|
) INHERITS (emp, student);
|
2001-03-30 22:50:36 +02:00
|
|
|
NOTICE: CREATE TABLE: merging multiple inherited definitions of attribute "name"
|
|
|
|
NOTICE: CREATE TABLE: merging multiple inherited definitions of attribute "age"
|
|
|
|
NOTICE: CREATE TABLE: merging multiple inherited definitions of attribute "location"
|
2000-01-05 18:31:08 +01:00
|
|
|
CREATE TABLE city (
|
1998-04-26 06:12:15 +02:00
|
|
|
name name,
|
1997-04-05 23:26:00 +02:00
|
|
|
location box,
|
|
|
|
budget city_budget
|
|
|
|
);
|
2000-01-05 18:31:08 +01:00
|
|
|
CREATE TABLE dept (
|
1998-04-26 06:12:15 +02:00
|
|
|
dname name,
|
1997-04-05 23:26:00 +02:00
|
|
|
mgrname text
|
|
|
|
);
|
2000-01-05 18:31:08 +01:00
|
|
|
CREATE TABLE slow_emp4000 (
|
1997-04-05 23:26:00 +02:00
|
|
|
home_base box
|
|
|
|
);
|
2000-01-05 18:31:08 +01:00
|
|
|
CREATE TABLE fast_emp4000 (
|
1997-04-05 23:26:00 +02:00
|
|
|
home_base box
|
|
|
|
);
|
2000-01-05 18:31:08 +01:00
|
|
|
CREATE TABLE road (
|
1997-04-05 23:26:00 +02:00
|
|
|
name text,
|
|
|
|
thepath path
|
|
|
|
);
|
2000-01-05 18:31:08 +01:00
|
|
|
CREATE TABLE ihighway () INHERITS (road);
|
|
|
|
CREATE TABLE shighway (
|
1997-04-05 23:26:00 +02:00
|
|
|
surface text
|
|
|
|
) INHERITS (road);
|
2000-01-05 18:31:08 +01:00
|
|
|
CREATE TABLE real_city (
|
|
|
|
pop int4,
|
1997-04-05 23:26:00 +02:00
|
|
|
cname text,
|
|
|
|
outline path
|
|
|
|
);
|
2000-01-05 18:31:08 +01:00
|
|
|
--
|
|
|
|
-- test the "star" operators a bit more thoroughly -- this time,
|
|
|
|
-- throw in lots of NULL fields...
|
|
|
|
--
|
|
|
|
-- a is the type root
|
|
|
|
-- b and c inherit from a (one-level single inheritance)
|
|
|
|
-- d inherits from b and c (two-level multiple inheritance)
|
|
|
|
-- e inherits from c (two-level single inheritance)
|
|
|
|
-- f inherits from e (three-level single inheritance)
|
|
|
|
--
|
|
|
|
CREATE TABLE a_star (
|
|
|
|
class char,
|
|
|
|
a int4
|
|
|
|
);
|
|
|
|
CREATE TABLE b_star (
|
|
|
|
b text
|
1997-04-05 23:26:00 +02:00
|
|
|
) INHERITS (a_star);
|
2000-01-05 18:31:08 +01:00
|
|
|
CREATE TABLE c_star (
|
|
|
|
c name
|
1997-04-05 23:26:00 +02:00
|
|
|
) INHERITS (a_star);
|
2000-01-05 18:31:08 +01:00
|
|
|
CREATE TABLE d_star (
|
|
|
|
d float8
|
1997-04-05 23:26:00 +02:00
|
|
|
) INHERITS (b_star, c_star);
|
2001-03-30 22:50:36 +02:00
|
|
|
NOTICE: CREATE TABLE: merging multiple inherited definitions of attribute "class"
|
|
|
|
NOTICE: CREATE TABLE: merging multiple inherited definitions of attribute "a"
|
2000-01-05 18:31:08 +01:00
|
|
|
CREATE TABLE e_star (
|
|
|
|
e int2
|
1997-04-05 23:26:00 +02:00
|
|
|
) INHERITS (c_star);
|
2000-01-05 18:31:08 +01:00
|
|
|
CREATE TABLE f_star (
|
|
|
|
f polygon
|
1997-04-05 23:26:00 +02:00
|
|
|
) INHERITS (e_star);
|
2000-01-05 18:31:08 +01:00
|
|
|
CREATE TABLE aggtest (
|
|
|
|
a int2,
|
|
|
|
b float4
|
|
|
|
);
|
|
|
|
CREATE TABLE hash_i4_heap (
|
1997-04-05 23:26:00 +02:00
|
|
|
seqno int4,
|
|
|
|
random int4
|
|
|
|
);
|
2000-01-05 18:31:08 +01:00
|
|
|
CREATE TABLE hash_name_heap (
|
1997-04-05 23:26:00 +02:00
|
|
|
seqno int4,
|
1998-04-26 06:12:15 +02:00
|
|
|
random name
|
1997-04-05 23:26:00 +02:00
|
|
|
);
|
2000-01-05 18:31:08 +01:00
|
|
|
CREATE TABLE hash_txt_heap (
|
1997-04-05 23:26:00 +02:00
|
|
|
seqno int4,
|
|
|
|
random text
|
|
|
|
);
|
2000-01-05 18:31:08 +01:00
|
|
|
CREATE TABLE hash_f8_heap (
|
1997-04-05 23:26:00 +02:00
|
|
|
seqno int4,
|
|
|
|
random float8
|
|
|
|
);
|
2000-01-05 18:31:08 +01:00
|
|
|
-- don't include the hash_ovfl_heap stuff in the distribution
|
|
|
|
-- the data set is too large for what it's worth
|
|
|
|
--
|
|
|
|
-- CREATE TABLE hash_ovfl_heap (
|
|
|
|
-- x int4,
|
|
|
|
-- y int4
|
|
|
|
-- );
|
|
|
|
CREATE TABLE bt_i4_heap (
|
1997-04-05 23:26:00 +02:00
|
|
|
seqno int4,
|
|
|
|
random int4
|
|
|
|
);
|
2000-01-05 18:31:08 +01:00
|
|
|
CREATE TABLE bt_name_heap (
|
1998-04-26 06:12:15 +02:00
|
|
|
seqno name,
|
1997-04-05 23:26:00 +02:00
|
|
|
random int4
|
|
|
|
);
|
2000-01-05 18:31:08 +01:00
|
|
|
CREATE TABLE bt_txt_heap (
|
1997-04-05 23:26:00 +02:00
|
|
|
seqno text,
|
|
|
|
random int4
|
|
|
|
);
|
2000-01-05 18:31:08 +01:00
|
|
|
CREATE TABLE bt_f8_heap (
|
|
|
|
seqno float8,
|
1997-04-05 23:26:00 +02:00
|
|
|
random int4
|
|
|
|
);
|