6
6
*
7
7
*
8
8
* IDENTIFICATION
9
- * $Header: /cvsroot/pgsql/src/backend/commands/copy.c,v 1.7 1996/08/27 22:17:08 scrappy Exp $
9
+ * $Header: /cvsroot/pgsql/src/backend/commands/copy.c,v 1.8 1996/10/18 05:59:17 scrappy Exp $
10
10
*
11
11
*-------------------------------------------------------------------------
12
12
*/
44
44
#include "utils/palloc.h"
45
45
#include "fmgr.h"
46
46
47
+ #define ISOCTAL (c ) (((c) >= '0') && ((c) <= '7'))
48
+ #define VALUE (c ) ((c) - '0')
49
+
47
50
/*
48
51
* New copy code.
49
52
*
@@ -745,9 +748,6 @@ CopyReadAttribute(FILE *fp, bool *isnull, char *delim)
745
748
return (NULL );
746
749
else if (c == '\\' ) {
747
750
c = getc (fp );
748
- #ifdef ESCAPE_PATCH
749
- #define ISOCTAL (c ) (((c) >= '0') && ((c) <= '7'))
750
- #define VALUE (c ) ((c) - '0')
751
751
if (feof (fp ))
752
752
return (NULL );
753
753
switch (c ) {
@@ -809,7 +809,6 @@ CopyReadAttribute(FILE *fp, bool *isnull, char *delim)
809
809
return (NULL );
810
810
break ;
811
811
}
812
- #endif
813
812
}else if (inString (c ,delim ) || c == '\n' ) {
814
813
done = 1 ;
815
814
}
@@ -821,7 +820,6 @@ CopyReadAttribute(FILE *fp, bool *isnull, char *delim)
821
820
return (& attribute [0 ]);
822
821
}
823
822
824
- #ifdef ESCAPE_PATCH
825
823
static void
826
824
CopyAttributeOut (FILE * fp , char * string , char * delim )
827
825
{
@@ -853,21 +851,6 @@ CopyAttributeOut(FILE *fp, char *string, char *delim)
853
851
fputc (* string , fp );
854
852
}
855
853
}
856
- #else
857
- static void
858
- CopyAttributeOut (FILE * fp , char * string , char * delim )
859
- {
860
- int i ;
861
- int len = strlen (string );
862
-
863
- for (i = 0 ; i < len ; i ++ ) {
864
- if (string [i ] == delim [0 ] || string [i ] == '\n' || string [i ] == '\\' ) {
865
- fputc ('\\' , fp );
866
- }
867
- fputc (string [i ], fp );
868
- }
869
- }
870
- #endif
871
854
872
855
/*
873
856
* Returns the number of tuples in a relation. Unfortunately, currently
0 commit comments