Fix pg_dump bug in the database-level collation patch. "datcollate" and
[PostgreSQL.git] / src / test / regress / sql / create_table.sql
blobe43371eed93be6494c66bd2aadb85938dbfd7bb2
1 --
2 -- CREATE_TABLE
3 --
5 --
6 -- CLASS DEFINITIONS
7 --
8 CREATE TABLE hobbies_r (
9         name            text, 
10         person          text
13 CREATE TABLE equipment_r (
14         name            text,
15         hobby           text
18 CREATE TABLE onek (
19         unique1         int4,
20         unique2         int4,
21         two                     int4,
22         four            int4,
23         ten                     int4,
24         twenty          int4,
25         hundred         int4,
26         thousand        int4,
27         twothousand     int4,
28         fivethous       int4,
29         tenthous        int4,
30         odd                     int4,
31         even            int4,
32         stringu1        name,
33         stringu2        name,
34         string4         name
37 CREATE TABLE tenk1 (
38         unique1         int4,
39         unique2         int4,
40         two                     int4,
41         four            int4,
42         ten                     int4,
43         twenty          int4,
44         hundred         int4,
45         thousand        int4,
46         twothousand     int4,
47         fivethous       int4,
48         tenthous        int4,
49         odd                     int4,
50         even            int4,
51         stringu1        name,
52         stringu2        name,
53         string4         name
54 ) WITH OIDS;
56 CREATE TABLE tenk2 (
57         unique1         int4,
58         unique2         int4,
59         two             int4,
60         four            int4,
61         ten                     int4,
62         twenty          int4,
63         hundred         int4,
64         thousand        int4,
65         twothousand int4,
66         fivethous       int4,
67         tenthous        int4,
68         odd                     int4,
69         even            int4,
70         stringu1        name,
71         stringu2        name,
72         string4         name
76 CREATE TABLE person (
77         name            text,
78         age                     int4,
79         location        point
83 CREATE TABLE emp (
84         salary          int4,
85         manager         name
86 ) INHERITS (person) WITH OIDS;
89 CREATE TABLE student (
90         gpa             float8
91 ) INHERITS (person);
94 CREATE TABLE stud_emp (
95         percent         int4
96 ) INHERITS (emp, student);
99 CREATE TABLE city (
100         name            name,
101         location        box,
102         budget          city_budget
105 CREATE TABLE dept (
106         dname           name,
107         mgrname         text
110 CREATE TABLE slow_emp4000 (
111         home_base        box
114 CREATE TABLE fast_emp4000 (
115         home_base        box
118 CREATE TABLE road (
119         name            text,
120         thepath         path
123 CREATE TABLE ihighway () INHERITS (road);
125 CREATE TABLE shighway (
126         surface         text
127 ) INHERITS (road);
129 CREATE TABLE real_city (
130         pop                     int4,
131         cname           text,
132         outline         path
136 -- test the "star" operators a bit more thoroughly -- this time,
137 -- throw in lots of NULL fields...
139 -- a is the type root
140 -- b and c inherit from a (one-level single inheritance)
141 -- d inherits from b and c (two-level multiple inheritance)
142 -- e inherits from c (two-level single inheritance)
143 -- f inherits from e (three-level single inheritance)
145 CREATE TABLE a_star (
146         class           char, 
147         a                       int4
150 CREATE TABLE b_star (
151         b                       text
152 ) INHERITS (a_star);
154 CREATE TABLE c_star (
155         c                       name
156 ) INHERITS (a_star);
158 CREATE TABLE d_star (
159         d                       float8
160 ) INHERITS (b_star, c_star);
162 CREATE TABLE e_star (
163         e                       int2
164 ) INHERITS (c_star);
166 CREATE TABLE f_star (
167         f                       polygon
168 ) INHERITS (e_star);
170 CREATE TABLE aggtest (
171         a                       int2,
172         b                       float4
175 CREATE TABLE hash_i4_heap (
176         seqno           int4,
177         random          int4
180 CREATE TABLE hash_name_heap (
181         seqno           int4,
182         random          name
185 CREATE TABLE hash_txt_heap (
186         seqno           int4,
187         random          text
190 CREATE TABLE hash_f8_heap (
191         seqno           int4,
192         random          float8
195 -- don't include the hash_ovfl_heap stuff in the distribution
196 -- the data set is too large for what it's worth
197 -- 
198 -- CREATE TABLE hash_ovfl_heap (
199 --      x                       int4,
200 --      y                       int4
201 -- );
203 CREATE TABLE bt_i4_heap (
204         seqno           int4,
205         random          int4
208 CREATE TABLE bt_name_heap (
209         seqno           name,
210         random          int4
213 CREATE TABLE bt_txt_heap (
214         seqno           text,
215         random          int4
218 CREATE TABLE bt_f8_heap (
219         seqno           float8, 
220         random          int4
223 CREATE TABLE array_op_test (
224         seqno           int4,
225         i                       int4[],
226         t                       text[]
229 CREATE TABLE array_index_op_test (
230         seqno           int4,
231         i                       int4[],
232         t                       text[]
235 CREATE TABLE test_tsvector( 
236         t text, 
237         a tsvector