csv header feature regression test - Mailing list pgsql-patches

From Andrew Dunstan
Subject csv header feature regression test
Date
Msg-id 427F946E.6060801@dunslane.net
Whole thread Raw
Responses Re: csv header feature regression test
List pgsql-patches
tiny patch to test this feature.

cheers

andrew
Index: input/copy.source
===================================================================
RCS file: /home/cvsmirror/pgsql/src/test/regress/input/copy.source,v
retrieving revision 1.11
diff -c -r1.11 copy.source
*** input/copy.source    16 Mar 2005 06:05:53 -0000    1.11
--- input/copy.source    9 May 2005 15:12:49 -0000
***************
*** 86,89 ****
--- 86,103 ----
  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;

Index: output/copy.source
===================================================================
RCS file: /home/cvsmirror/pgsql/src/test/regress/output/copy.source,v
retrieving revision 1.9
diff -c -r1.9 copy.source
*** output/copy.source    16 Mar 2005 06:05:53 -0000    1.9
--- output/copy.source    9 May 2005 16:42:04 -0000
***************
*** 58,60 ****
--- 58,70 ----
  -------+------+--------
  (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

pgsql-patches by date:

Previous
From: Neil Conway
Date:
Subject: Re: Added columns to pg_stat_activity
Next
From: Neil Conway
Date:
Subject: Re: csv header feature regression test