From: Neil Conway Date: Fri, 13 May 2005 06:33:40 +0000 (+0000) Subject: Add regression test for consecutive newlines in COPY CSV mode. (There is X-Git-Url: http://git.postgresql.org/gitweb/static/gitweb.js?a=commitdiff_plain;h=5f6f205d9bd14aec9e65f4578c534fbd38b35fba;p=users%2Fbernd%2Fpostgres.git Add regression test for consecutive newlines in COPY CSV mode. (There is no bug related to this functionality in HEAD, but it's worth adding a test for anyway.) From Andrew Dunstan. --- diff --git a/src/test/regress/expected/copy2.out b/src/test/regress/expected/copy2.out index 6a4769adac..40dd7f24af 100644 --- a/src/test/regress/expected/copy2.out +++ b/src/test/regress/expected/copy2.out @@ -191,6 +191,9 @@ COPY y TO stdout WITH CSV FORCE QUOTE col2 ESCAPE '\\'; "Jackson, Sam","\\h" "It is \"perfect\"."," " "", +--test that we read consecutive LFs properly +CREATE TEMP TABLE testnl (a int, b text, c int); +COPY testnl FROM stdin CSV; DROP TABLE x, y; DROP FUNCTION fn_x_before(); DROP FUNCTION fn_x_after(); diff --git a/src/test/regress/sql/copy2.sql b/src/test/regress/sql/copy2.sql index 78bbf4182e..eb1a69c095 100644 --- a/src/test/regress/sql/copy2.sql +++ b/src/test/regress/sql/copy2.sql @@ -129,6 +129,17 @@ COPY y TO stdout WITH CSV; COPY y TO stdout WITH CSV QUOTE '''' DELIMITER '|'; COPY y TO stdout WITH CSV FORCE QUOTE col2 ESCAPE '\\'; +--test that we read consecutive LFs properly + +CREATE TEMP TABLE testnl (a int, b text, c int); + +COPY testnl FROM stdin CSV; +1,"a field with two LFs + +inside",2 +\. + + DROP TABLE x, y; DROP FUNCTION fn_x_before(); DROP FUNCTION fn_x_after();