Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
P
postgres-lambda-diff
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Jakob Huber
postgres-lambda-diff
Commits
659660c1
Commit
659660c1
authored
20 years ago
by
Bruce Momjian
Browse files
Options
Downloads
Patches
Plain Diff
Add regression tests for CSV COPY format.
parent
337f8024
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/test/regress/expected/copy2.out
+19
-0
19 additions, 0 deletions
src/test/regress/expected/copy2.out
src/test/regress/sql/copy2.sql
+13
-0
13 additions, 0 deletions
src/test/regress/sql/copy2.sql
with
32 additions
and
0 deletions
src/test/regress/expected/copy2.out
+
19
−
0
View file @
659660c1
...
@@ -172,6 +172,25 @@ I'm null before trigger fired
...
@@ -172,6 +172,25 @@ I'm null before trigger fired
3 after trigger fired
3 after trigger fired
4 after trigger fired
4 after trigger fired
5 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 TABLE x;
DROP FUNCTION fn_x_before();
DROP FUNCTION fn_x_before();
DROP FUNCTION fn_x_after();
DROP FUNCTION fn_x_after();
This diff is collapsed.
Click to expand it.
src/test/regress/sql/copy2.sql
+
13
−
0
View file @
659660c1
...
@@ -116,6 +116,19 @@ COPY x TO stdout;
...
@@ -116,6 +116,19 @@ COPY x TO stdout;
COPY
x
(
c
,
e
)
TO
stdout
;
COPY
x
(
c
,
e
)
TO
stdout
;
COPY
x
(
b
,
e
)
TO
stdout
WITH
NULL
'I
''
m null'
;
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
TABLE
x
;
DROP
FUNCTION
fn_x_before
();
DROP
FUNCTION
fn_x_before
();
DROP
FUNCTION
fn_x_after
();
DROP
FUNCTION
fn_x_after
();
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment