4 CREATE TABLE temp (initial int4);
6 ALTER TABLE temp ADD COLUMN a int4;
8 ALTER TABLE temp ADD COLUMN b name;
10 ALTER TABLE temp ADD COLUMN c text;
12 ALTER TABLE temp ADD COLUMN d float8;
14 ALTER TABLE temp ADD COLUMN e float4;
16 ALTER TABLE temp ADD COLUMN f int2;
18 ALTER TABLE temp ADD COLUMN g polygon;
20 ALTER TABLE temp ADD COLUMN h abstime;
22 ALTER TABLE temp ADD COLUMN i char;
24 ALTER TABLE temp ADD COLUMN j abstime[];
26 ALTER TABLE temp ADD COLUMN k dt;
28 ALTER TABLE temp ADD COLUMN l tid;
30 ALTER TABLE temp ADD COLUMN m xid;
32 ALTER TABLE temp ADD COLUMN n oid8;
34 --ALTER TABLE temp ADD COLUMN o lock;
35 ALTER TABLE temp ADD COLUMN p smgr;
37 ALTER TABLE temp ADD COLUMN q point;
39 ALTER TABLE temp ADD COLUMN r lseg;
41 ALTER TABLE temp ADD COLUMN s path;
43 ALTER TABLE temp ADD COLUMN t box;
45 ALTER TABLE temp ADD COLUMN u tinterval;
47 ALTER TABLE temp ADD COLUMN v datetime;
49 ALTER TABLE temp ADD COLUMN w timespan;
51 ALTER TABLE temp ADD COLUMN x float8[];
53 ALTER TABLE temp ADD COLUMN y float4[];
55 ALTER TABLE temp ADD COLUMN z int2[];
57 INSERT INTO temp (a, b, c, d, e, f, g, h, i, j, k, l, m, n, p, q, r, s, t, u,
59 VALUES (4, 'name', 'text', 4.1, 4.1, 2, '(4.1,4.1,3.1,3.1)',
60 'Mon May 1 00:30:30 1995', 'c', '{Mon May 1 00:30:30 1995, Monday Aug 24 14:43:07 1992, epoch}',
62 '1 2 3 4 5 6 7 8', 'magnetic disk', '(1.1,1.1)', '(4.1,4.1,3.1,3.1)',
63 '(0,2,4.1,4.1,3.1,3.1)', '(4.1,4.1,3.1,3.1)', '["current" "infinity"]',
64 '1/3', '1,name', '{1.0,2.0,3.0,4.0}', '{1.0,2.0,3.0,4.0}', '{1,2,3,4}');
70 -- the wolf bug - schema mods caused inconsistent row descriptors
75 ALTER TABLE temp ADD COLUMN a int4;
77 ALTER TABLE temp ADD COLUMN b name;
79 ALTER TABLE temp ADD COLUMN c text;
81 ALTER TABLE temp ADD COLUMN d float8;
83 ALTER TABLE temp ADD COLUMN e float4;
85 ALTER TABLE temp ADD COLUMN f int2;
87 ALTER TABLE temp ADD COLUMN g polygon;
89 ALTER TABLE temp ADD COLUMN h abstime;
91 ALTER TABLE temp ADD COLUMN i char;
93 ALTER TABLE temp ADD COLUMN j abstime[];
95 ALTER TABLE temp ADD COLUMN k dt;
97 ALTER TABLE temp ADD COLUMN l tid;
99 ALTER TABLE temp ADD COLUMN m xid;
101 ALTER TABLE temp ADD COLUMN n oid8;
103 --ALTER TABLE temp ADD COLUMN o lock;
104 ALTER TABLE temp ADD COLUMN p smgr;
106 ALTER TABLE temp ADD COLUMN q point;
108 ALTER TABLE temp ADD COLUMN r lseg;
110 ALTER TABLE temp ADD COLUMN s path;
112 ALTER TABLE temp ADD COLUMN t box;
114 ALTER TABLE temp ADD COLUMN u tinterval;
116 ALTER TABLE temp ADD COLUMN v datetime;
118 ALTER TABLE temp ADD COLUMN w timespan;
120 ALTER TABLE temp ADD COLUMN x float8[];
122 ALTER TABLE temp ADD COLUMN y float4[];
124 ALTER TABLE temp ADD COLUMN z int2[];
126 INSERT INTO temp (a, b, c, d, e, f, g, h, i, j, k, l, m, n, p, q, r, s, t, u,
128 VALUES (4, 'name', 'text', 4.1, 4.1, 2, '(4.1,4.1,3.1,3.1)',
129 'Mon May 1 00:30:30 1995', 'c', '{Mon May 1 00:30:30 1995, Monday Aug 24 14:43:07 1992, epoch}',
130 314159, '(1,1)', 512,
131 '1 2 3 4 5 6 7 8', 'magnetic disk', '(1.1,1.1)', '(4.1,4.1,3.1,3.1)',
132 '(0,2,4.1,4.1,3.1,3.1)', '(4.1,4.1,3.1,3.1)', '["current" "infinity"]',
133 '1/3', '1,name', '{1.0,2.0,3.0,4.0}', '{1.0,2.0,3.0,4.0}', '{1,2,3,4}');
142 -- should preserve indices
144 ALTER TABLE tenk1 RENAME TO ten_k;
147 SELECT unique1 FROM ten_k WHERE unique1 < 20;
150 SELECT unique2 FROM ten_k WHERE unique2 < 20;
152 -- 100 values, sorted
153 SELECT hundred FROM ten_k WHERE hundred = 50;
155 ALTER TABLE ten_k RENAME TO tenk1;
158 SELECT unique1 FROM tenk1 WHERE unique1 < 5;