@@ -24,70 +24,6 @@ VACUUM FULL copy_stmt_hooking.test_1;
24
24
VACUUM FULL copy_stmt_hooking.test_2;
25
25
VACUUM FULL copy_stmt_hooking.test_3;
26
26
VACUUM FULL copy_stmt_hooking.test_4;
27
- /* COPY TO */
28
- COPY copy_stmt_hooking.test TO stdout;
29
- 1 comment \N \N
30
- 2 comment \N \N
31
- 3 comment \N \N
32
- 4 comment \N \N
33
- 5 comment \N \N
34
- 6 comment \N \N
35
- 7 comment \N \N
36
- 8 comment \N \N
37
- 9 comment \N \N
38
- 10 comment \N \N
39
- 11 comment \N \N
40
- 12 comment \N \N
41
- 13 comment \N \N
42
- 14 comment \N \N
43
- 15 comment \N \N
44
- 16 comment \N \N
45
- 17 comment \N \N
46
- 18 comment \N \N
47
- 19 comment \N \N
48
- 20 comment \N \N
49
- \copy copy_stmt_hooking.test to stdout (format csv)
50
- 1,comment,,
51
- 2,comment,,
52
- 3,comment,,
53
- 4,comment,,
54
- 5,comment,,
55
- 6,comment,,
56
- 7,comment,,
57
- 8,comment,,
58
- 9,comment,,
59
- 10,comment,,
60
- 11,comment,,
61
- 12,comment,,
62
- 13,comment,,
63
- 14,comment,,
64
- 15,comment,,
65
- 16,comment,,
66
- 17,comment,,
67
- 18,comment,,
68
- 19,comment,,
69
- 20,comment,,
70
- \copy copy_stmt_hooking.test(comment) to stdout
71
- comment
72
- comment
73
- comment
74
- comment
75
- comment
76
- comment
77
- comment
78
- comment
79
- comment
80
- comment
81
- comment
82
- comment
83
- comment
84
- comment
85
- comment
86
- comment
87
- comment
88
- comment
89
- comment
90
- comment
91
27
/* DELETE ROWS, COPY FROM */
92
28
DELETE FROM copy_stmt_hooking.test;
93
29
COPY copy_stmt_hooking.test FROM stdin;
@@ -113,32 +49,30 @@ VACUUM FULL copy_stmt_hooking.test_1;
113
49
VACUUM FULL copy_stmt_hooking.test_2;
114
50
VACUUM FULL copy_stmt_hooking.test_3;
115
51
VACUUM FULL copy_stmt_hooking.test_4;
116
- /* COPY FROM (specified columns) */
117
- COPY copy_stmt_hooking.test (val) TO stdout;
118
- 1
119
- 6
120
- 7
121
- 11
122
- 16
123
- COPY copy_stmt_hooking.test (val, comment) TO stdout;
124
- 1 test_1
125
- 6 test_2
126
- 7 test_2
127
- 11 test_3
128
- 16 test_4
129
- COPY copy_stmt_hooking.test (c3, val, comment) TO stdout;
130
- 0 1 test_1
131
- 0 6 test_2
132
- 0 7 test_2
133
- 0 11 test_3
134
- 0 16 test_4
135
- COPY copy_stmt_hooking.test (val, comment, c3, c4) TO stdout;
52
+ /* COPY TO */
53
+ COPY copy_stmt_hooking.test TO stdout; /* not ok */
54
+ WARNING: COPY TO will only select rows from parent table "test"
55
+ COPY copy_stmt_hooking.test (val) TO stdout; /* not ok */
56
+ WARNING: COPY TO will only select rows from parent table "test"
57
+ COPY (SELECT * FROM copy_stmt_hooking.test) TO stdout;
58
+ 1 test_1 0 0
59
+ 6 test_2 0 0
60
+ 7 test_2 0 0
61
+ 11 test_3 0 0
62
+ 16 test_4 0 0
63
+ COPY (SELECT * FROM copy_stmt_hooking.test) TO stdout (FORMAT CSV);
64
+ 1,test_1,0,0
65
+ 6,test_2,0,0
66
+ 7,test_2,0,0
67
+ 11,test_3,0,0
68
+ 16,test_4,0,0
69
+ \copy (SELECT * FROM copy_stmt_hooking.test) TO stdout
136
70
1 test_1 0 0
137
71
6 test_2 0 0
138
72
7 test_2 0 0
139
73
11 test_3 0 0
140
74
16 test_4 0 0
141
- /* COPY TO (partition does not exist, NOT allowed to create partitions) */
75
+ /* COPY FROM (partition does not exist, NOT allowed to create partitions) */
142
76
SET pg_pathman.enable_auto_partition = OFF;
143
77
COPY copy_stmt_hooking.test FROM stdin;
144
78
ERROR: no suitable partition for key '21'
@@ -147,7 +81,7 @@ SELECT * FROM copy_stmt_hooking.test WHERE val > 20;
147
81
-----+---------+----+----
148
82
(0 rows)
149
83
150
- /* COPY TO (partition does not exist, allowed to create partitions) */
84
+ /* COPY FROM (partition does not exist, allowed to create partitions) */
151
85
SET pg_pathman.enable_auto_partition = ON;
152
86
COPY copy_stmt_hooking.test FROM stdin;
153
87
SELECT * FROM copy_stmt_hooking.test WHERE val > 20;
@@ -194,18 +128,18 @@ WHERE attnum > 0 AND attrelid = 'copy_stmt_hooking.test_6'::REGCLASS;
194
128
3
195
129
(1 row)
196
130
197
- /* COPY FROM ( test transformed tuples) */
198
- COPY copy_stmt_hooking.test (val, c3, c4 ) TO stdout;
131
+ /* test transformed tuples */
132
+ COPY (SELECT * FROM copy_stmt_hooking.test ) TO stdout;
199
133
1 0 0
200
134
6 0 0
201
135
7 0 0
202
136
11 0 0
203
137
16 0 0
204
138
21 0 0
205
139
26 1 2
206
- /* COPY TO (insert into table with dropped column) */
140
+ /* COPY FROM (insert into table with dropped column) */
207
141
COPY copy_stmt_hooking.test(val, c3, c4) FROM stdin;
208
- /* COPY TO (insert into table without dropped column) */
142
+ /* COPY FROM (insert into table without dropped column) */
209
143
COPY copy_stmt_hooking.test(val, c3, c4) FROM stdin;
210
144
/* check tuples from last partition (without dropped column) */
211
145
SELECT *, tableoid::REGCLASS FROM copy_stmt_hooking.test ORDER BY val;
0 commit comments