diff --git a/src/test/regress/expected/copy2.out b/src/test/regress/expected/copy2.out index eb9e4b9774..f5f5c4c407 100644 --- a/src/test/regress/expected/copy2.out +++ b/src/test/regress/expected/copy2.out @@ -557,6 +557,16 @@ SELECT * FROM instead_of_insert_tbl; 1 | test1 (1 row) +-- test header line feature +create temp table copytest3 ( + c1 int, + "col with , comma" text, + "col with "" quote" int); +copy copytest3 from stdin csv header; +copy copytest3 to stdout csv header; +c1,"col with , comma","col with "" quote" +1,a,1 +2,b,2 -- clean up DROP TABLE forcetest; DROP TABLE vistest; diff --git a/src/test/regress/input/copy.source b/src/test/regress/input/copy.source index cb13606d14..20a140ab78 100644 --- a/src/test/regress/input/copy.source +++ b/src/test/regress/input/copy.source @@ -117,19 +117,3 @@ copy copytest to '@abs_builddir@/results/copytest.csv' csv quote '''' escape E'\ copy copytest2 from '@abs_builddir@/results/copytest.csv' csv quote '''' escape E'\\'; select * from copytest except select * from copytest2; - - --- test header line feature - -create temp table copytest3 ( - c1 int, - "col with , comma" text, - "col with "" quote" int); - -copy copytest3 from stdin csv header; -this is just a line full of junk that would error out if parsed -1,a,1 -2,b,2 -\. - -copy copytest3 to stdout csv header; diff --git a/src/test/regress/output/copy.source b/src/test/regress/output/copy.source index b7e372d61b..9314622768 100644 --- a/src/test/regress/output/copy.source +++ b/src/test/regress/output/copy.source @@ -85,13 +85,3 @@ select * from copytest except select * from copytest2; -------+------+-------- (0 rows) --- test header line feature -create temp table copytest3 ( - c1 int, - "col with , comma" text, - "col with "" quote" int); -copy copytest3 from stdin csv header; -copy copytest3 to stdout csv header; -c1,"col with , comma","col with "" quote" -1,a,1 -2,b,2 diff --git a/src/test/regress/sql/copy2.sql b/src/test/regress/sql/copy2.sql index f3a6d228fa..ce87f778a6 100644 --- a/src/test/regress/sql/copy2.sql +++ b/src/test/regress/sql/copy2.sql @@ -411,6 +411,19 @@ test1 SELECT * FROM instead_of_insert_tbl; +-- test header line feature +create temp table copytest3 ( + c1 int, + "col with , comma" text, + "col with "" quote" int); + +copy copytest3 from stdin csv header; +this is just a line full of junk that would error out if parsed +1,a,1 +2,b,2 +\. + +copy copytest3 to stdout csv header; -- clean up DROP TABLE forcetest;