]> granicus.if.org Git - postgresql/blob - src/test/regress/output/copy.source
Update copyright for the year 2010.
[postgresql] / src / test / regress / output / copy.source
1 --
2 -- COPY
3 --
4 -- CLASS POPULATION
5 --      (any resemblance to real life is purely coincidental)
6 --
7 COPY aggtest FROM '@abs_srcdir@/data/agg.data';
8 COPY onek FROM '@abs_srcdir@/data/onek.data';
9 COPY onek TO '@abs_builddir@/results/onek.data';
10 DELETE FROM onek;
11 COPY onek FROM '@abs_builddir@/results/onek.data';
12 COPY tenk1 FROM '@abs_srcdir@/data/tenk.data';
13 COPY slow_emp4000 FROM '@abs_srcdir@/data/rect.data';
14 COPY person FROM '@abs_srcdir@/data/person.data';
15 COPY emp FROM '@abs_srcdir@/data/emp.data';
16 COPY student FROM '@abs_srcdir@/data/student.data';
17 COPY stud_emp FROM '@abs_srcdir@/data/stud_emp.data';
18 COPY road FROM '@abs_srcdir@/data/streets.data';
19 COPY real_city FROM '@abs_srcdir@/data/real_city.data';
20 COPY hash_i4_heap FROM '@abs_srcdir@/data/hash.data';
21 COPY hash_name_heap FROM '@abs_srcdir@/data/hash.data';
22 COPY hash_txt_heap FROM '@abs_srcdir@/data/hash.data';
23 COPY hash_f8_heap FROM '@abs_srcdir@/data/hash.data';
24 COPY test_tsvector FROM '@abs_srcdir@/data/tsearch.data';
25 -- the data in this file has a lot of duplicates in the index key
26 -- fields, leading to long bucket chains and lots of table expansion.
27 -- this is therefore a stress test of the bucket overflow code (unlike
28 -- the data in hash.data, which has unique index keys).
29 --
30 -- COPY hash_ovfl_heap FROM '@abs_srcdir@/data/hashovfl.data';
31 COPY bt_i4_heap FROM '@abs_srcdir@/data/desc.data';
32 COPY bt_name_heap FROM '@abs_srcdir@/data/hash.data';
33 COPY bt_txt_heap FROM '@abs_srcdir@/data/desc.data';
34 COPY bt_f8_heap FROM '@abs_srcdir@/data/hash.data';
35 COPY array_op_test FROM '@abs_srcdir@/data/array.data';
36 COPY array_index_op_test FROM '@abs_srcdir@/data/array.data';
37 --- test copying in CSV mode with various styles
38 --- of embedded line ending characters
39 create temp table copytest (
40         style   text,
41         test    text,
42         filler  int);
43 insert into copytest values('DOS',E'abc\r\ndef',1);
44 insert into copytest values('Unix',E'abc\ndef',2);
45 insert into copytest values('Mac',E'abc\rdef',3);
46 insert into copytest values(E'esc\\ape',E'a\\r\\\r\\\n\\nb',4);
47 copy copytest to '@abs_builddir@/results/copytest.csv' csv;
48 create temp table copytest2 (like copytest);
49 copy copytest2 from '@abs_builddir@/results/copytest.csv' csv;
50 select * from copytest except select * from copytest2;
51  style | test | filler 
52 -------+------+--------
53 (0 rows)
54
55 truncate copytest2;
56 --- same test but with an escape char different from quote char
57 copy copytest to '@abs_builddir@/results/copytest.csv' csv quote '''' escape E'\\';
58 copy copytest2 from '@abs_builddir@/results/copytest.csv' csv quote '''' escape E'\\';
59 select * from copytest except select * from copytest2;
60  style | test | filler 
61 -------+------+--------
62 (0 rows)
63
64 -- test header line feature
65 create temp table copytest3 (
66         c1 int, 
67         "col with , comma" text, 
68         "col with "" quote"  int);
69 copy copytest3 from stdin csv header;
70 copy copytest3 to stdout csv header;
71 c1,"col with , comma","col with "" quote"
72 1,a,1
73 2,b,2