Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Postgres FD Implementation
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Abuhujair Javed
Postgres FD Implementation
Commits
659660c1
Commit
659660c1
authored
Jun 09, 2004
by
Bruce Momjian
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add regression tests for CSV COPY format.
parent
337f8024
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
32 additions
and
0 deletions
+32
-0
src/test/regress/expected/copy2.out
src/test/regress/expected/copy2.out
+19
-0
src/test/regress/sql/copy2.sql
src/test/regress/sql/copy2.sql
+13
-0
No files found.
src/test/regress/expected/copy2.out
View file @
659660c1
...
...
@@ -172,6 +172,25 @@ I'm null before trigger fired
3 after trigger fired
4 after trigger fired
5 after trigger fired
CREATE TABLE y (
col1 text,
col2 text
);
INSERT INTO y VALUES ('Jackson, Sam', '\\h');
INSERT INTO y VALUES ('It is "perfect".','\t');
INSERT INTO y VALUES ('', NULL);
COPY y TO stdout WITH CSV;
"Jackson, Sam",\h
"It is ""perfect"".",
"",
COPY y TO stdout WITH CSV QUOTE '''' DELIMITER '|';
Jackson, Sam|\h
It is "perfect".|
''|
COPY y TO stdout WITH CSV FORCE QUOTE col2 ESCAPE '\\';
"Jackson, Sam","\\h"
"It is \"perfect\"."," "
"",
DROP TABLE x;
DROP FUNCTION fn_x_before();
DROP FUNCTION fn_x_after();
src/test/regress/sql/copy2.sql
View file @
659660c1
...
...
@@ -116,6 +116,19 @@ COPY x TO stdout;
COPY
x
(
c
,
e
)
TO
stdout
;
COPY
x
(
b
,
e
)
TO
stdout
WITH
NULL
'I
''
m null'
;
CREATE
TABLE
y
(
col1
text
,
col2
text
);
INSERT
INTO
y
VALUES
(
'Jackson, Sam'
,
'
\\
h'
);
INSERT
INTO
y
VALUES
(
'It is "perfect".'
,
'
\t
'
);
INSERT
INTO
y
VALUES
(
''
,
NULL
);
COPY
y
TO
stdout
WITH
CSV
;
COPY
y
TO
stdout
WITH
CSV
QUOTE
'
''
'
DELIMITER
'|'
;
COPY
y
TO
stdout
WITH
CSV
FORCE
QUOTE
col2
ESCAPE
'
\\
'
;
DROP
TABLE
x
;
DROP
FUNCTION
fn_x_before
();
DROP
FUNCTION
fn_x_after
();
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment