4 CREATE TABLE tmp (initial int4);
6 ALTER TABLE tmp ADD COLUMN a int4;
8 ALTER TABLE tmp ADD COLUMN b name;
10 ALTER TABLE tmp ADD COLUMN c text;
12 ALTER TABLE tmp ADD COLUMN d float8;
14 ALTER TABLE tmp ADD COLUMN e float4;
16 ALTER TABLE tmp ADD COLUMN f int2;
18 ALTER TABLE tmp ADD COLUMN g polygon;
20 ALTER TABLE tmp ADD COLUMN h abstime;
22 ALTER TABLE tmp ADD COLUMN i char;
24 ALTER TABLE tmp ADD COLUMN j abstime[];
26 ALTER TABLE tmp ADD COLUMN k dt;
28 ALTER TABLE tmp ADD COLUMN l tid;
30 ALTER TABLE tmp ADD COLUMN m xid;
32 ALTER TABLE tmp ADD COLUMN n oid8;
34 --ALTER TABLE tmp ADD COLUMN o lock;
35 ALTER TABLE tmp ADD COLUMN p smgr;
37 ALTER TABLE tmp ADD COLUMN q point;
39 ALTER TABLE tmp ADD COLUMN r lseg;
41 ALTER TABLE tmp ADD COLUMN s path;
43 ALTER TABLE tmp ADD COLUMN t box;
45 ALTER TABLE tmp ADD COLUMN u tinterval;
47 ALTER TABLE tmp ADD COLUMN v datetime;
49 ALTER TABLE tmp ADD COLUMN w timespan;
51 ALTER TABLE tmp ADD COLUMN x float8[];
53 ALTER TABLE tmp ADD COLUMN y float4[];
55 ALTER TABLE tmp ADD COLUMN z int2[];
57 INSERT INTO tmp (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 tmp ADD COLUMN a int4;
77 ALTER TABLE tmp ADD COLUMN b name;
79 ALTER TABLE tmp ADD COLUMN c text;
81 ALTER TABLE tmp ADD COLUMN d float8;
83 ALTER TABLE tmp ADD COLUMN e float4;
85 ALTER TABLE tmp ADD COLUMN f int2;
87 ALTER TABLE tmp ADD COLUMN g polygon;
89 ALTER TABLE tmp ADD COLUMN h abstime;
91 ALTER TABLE tmp ADD COLUMN i char;
93 ALTER TABLE tmp ADD COLUMN j abstime[];
95 ALTER TABLE tmp ADD COLUMN k dt;
97 ALTER TABLE tmp ADD COLUMN l tid;
99 ALTER TABLE tmp ADD COLUMN m xid;
101 ALTER TABLE tmp ADD COLUMN n oid8;
103 --ALTER TABLE tmp ADD COLUMN o lock;
104 ALTER TABLE tmp ADD COLUMN p smgr;
106 ALTER TABLE tmp ADD COLUMN q point;
108 ALTER TABLE tmp ADD COLUMN r lseg;
110 ALTER TABLE tmp ADD COLUMN s path;
112 ALTER TABLE tmp ADD COLUMN t box;
114 ALTER TABLE tmp ADD COLUMN u tinterval;
116 ALTER TABLE tmp ADD COLUMN v datetime;
118 ALTER TABLE tmp ADD COLUMN w timespan;
120 ALTER TABLE tmp ADD COLUMN x float8[];
122 ALTER TABLE tmp ADD COLUMN y float4[];
124 ALTER TABLE tmp ADD COLUMN z int2[];
126 INSERT INTO tmp (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;