Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commita342979

Browse files
committed
Rewrite some regression queries for option checks with COPY
Some queries in copy2 are there to check various option combinations,and used "stdin" or "stdout" incompatible with the COPY TO or FROMclauses combined with them, which was confusing. This commit rewritesthese queries to use a compatible grammar.The coverage of the tests is unchanged. Like the original commit451d116, backpatch down to 16 where these have been introduced. Afollow-up commit will rely on this area of the tests for a bug fix.Author: Joel JacobsonReviewed-by: Zhang MingliDiscussion:https://postgr.es/m/65030d1d-5f90-4fa4-92eb-f5f50389858e@app.fastmail.comBackpatch-through: 16
1 parent25d639e commita342979

File tree

2 files changed

+14
-14
lines changed

2 files changed

+14
-14
lines changed

‎src/test/regress/expected/copy2.out‎

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -78,21 +78,21 @@ ERROR: conflicting or redundant options
7878
LINE 1: COPY x from stdin (encoding 'sql_ascii', encoding 'sql_ascii...
7979
^
8080
-- incorrect options
81-
COPY xto stdin (format BINARY, delimiter ',');
81+
COPY xfrom stdin (format BINARY, delimiter ',');
8282
ERROR: cannot specify DELIMITER in BINARY mode
83-
COPY xto stdin (format BINARY, null 'x');
83+
COPY xfrom stdin (format BINARY, null 'x');
8484
ERROR: cannot specify NULL in BINARY mode
85-
COPY xto stdin (format TEXT, force_quote(a));
85+
COPY xfrom stdin (format TEXT, force_quote(a));
8686
ERROR: COPY force quote available only in CSV mode
8787
COPY x from stdin (format CSV, force_quote(a));
8888
ERROR: COPY force quote only available using COPY TO
89-
COPY xto stdout (format TEXT, force_not_null(a));
89+
COPY xfrom stdin (format TEXT, force_not_null(a));
9090
ERROR: COPY force not null available only in CSV mode
91-
COPY x tostdin (format CSV, force_not_null(a));
91+
COPY x tostdout (format CSV, force_not_null(a));
9292
ERROR: COPY force not null only available using COPY FROM
93-
COPY xto stdout (format TEXT, force_null(a));
93+
COPY xfrom stdin (format TEXT, force_null(a));
9494
ERROR: COPY force null available only in CSV mode
95-
COPY x tostdin (format CSV, force_null(a));
95+
COPY x tostdout (format CSV, force_null(a));
9696
ERROR: COPY force null only available using COPY FROM
9797
-- too many columns in column list: should fail
9898
COPY x (a, b, c, d, e, d, c) from stdin;

‎src/test/regress/sql/copy2.sql‎

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -68,14 +68,14 @@ COPY x from stdin (convert_selectively (a), convert_selectively (b));
6868
COPY xfrom stdin (encoding'sql_ascii', encoding'sql_ascii');
6969

7070
-- incorrect options
71-
COPY xto stdin (format BINARY, delimiter',');
72-
COPY xto stdin (format BINARY,null'x');
73-
COPY xto stdin (formatTEXT, force_quote(a));
71+
COPY xfrom stdin (format BINARY, delimiter',');
72+
COPY xfrom stdin (format BINARY,null'x');
73+
COPY xfrom stdin (formatTEXT, force_quote(a));
7474
COPY xfrom stdin (format CSV, force_quote(a));
75-
COPY xto stdout (formatTEXT, force_not_null(a));
76-
COPY x tostdin (format CSV, force_not_null(a));
77-
COPY xto stdout (formatTEXT, force_null(a));
78-
COPY x tostdin (format CSV, force_null(a));
75+
COPY xfrom stdin (formatTEXT, force_not_null(a));
76+
COPY x tostdout (format CSV, force_not_null(a));
77+
COPY xfrom stdin (formatTEXT, force_null(a));
78+
COPY x tostdout (format CSV, force_null(a));
7979

8080
-- too many columns in column list: should fail
8181
COPY x (a, b, c, d, e, d, c)from stdin;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp