77 *
88 *
99 * IDENTIFICATION
10- * $Header: /cvsroot/pgsql/src/backend/commands/copy.c,v 1.147 2002/02/24 02:32:26 momjian Exp $
10+ * $Header: /cvsroot/pgsql/src/backend/commands/copy.c,v 1.148 2002/02/24 02:33:33 momjian Exp $
1111 *
1212 *-------------------------------------------------------------------------
1313 */
@@ -326,20 +326,22 @@ DoCopy(char *relname, bool binary, bool oids, bool from, bool pipe,
326326}
327327else
328328{
329- struct stat st ;
329+ struct stat st ;
330+
330331fp = AllocateFile (filename ,PG_BINARY_R );
331-
332- if (fp == NULL )
332+
333+ if (fp == NULL )
333334elog (ERROR ,"COPY command, running in backend with "
334335"effective uid %d, could not open file '%s' for "
335336"reading. Errno = %s (%d)." ,
336337 (int )geteuid (),filename ,strerror (errno ),errno );
337-
338- fstat (fileno (fp ),& st );
339- if (S_ISDIR (st .st_mode ) ){
340- FreeFile (fp );
341- elog (ERROR ,"COPY: %s is a directory." ,filename );
342- }
338+
339+ fstat (fileno (fp ),& st );
340+ if (S_ISDIR (st .st_mode ))
341+ {
342+ FreeFile (fp );
343+ elog (ERROR ,"COPY: %s is a directory." ,filename );
344+ }
343345}
344346CopyFrom (rel ,binary ,oids ,fp ,delim ,null_print );
345347}
@@ -368,7 +370,7 @@ DoCopy(char *relname, bool binary, bool oids, bool from, bool pipe,
368370else
369371{
370372mode_t oumask ;/* Pre-existing umask value */
371- struct stat st ;
373+ struct stat st ;
372374
373375/*
374376 * Prevent write to relative path ... too easy to shoot
@@ -387,11 +389,12 @@ DoCopy(char *relname, bool binary, bool oids, bool from, bool pipe,
387389"effective uid %d, could not open file '%s' for "
388390"writing. Errno = %s (%d)." ,
389391 (int )geteuid (),filename ,strerror (errno ),errno );
390- fstat (fileno (fp ),& st );
391- if (S_ISDIR (st .st_mode ) ){
392- FreeFile (fp );
393- elog (ERROR ,"COPY: %s is a directory." ,filename );
394- }
392+ fstat (fileno (fp ),& st );
393+ if (S_ISDIR (st .st_mode ))
394+ {
395+ FreeFile (fp );
396+ elog (ERROR ,"COPY: %s is a directory." ,filename );
397+ }
395398}
396399CopyTo (rel ,binary ,oids ,fp ,delim ,null_print );
397400}
@@ -1097,25 +1100,25 @@ CopyReadAttribute(FILE *fp, bool *isnull, char *delim, int *newline, char *null_
10971100if (ISOCTAL (c ))
10981101{
10991102val = (val <<3 )+ OCTVALUE (c );
1100- CopyDonePeek (fp ,c , true/*pick up*/ );
1103+ CopyDonePeek (fp ,c , true/* pick up */ );
11011104c = CopyPeekChar (fp );
11021105if (ISOCTAL (c ))
11031106{
11041107val = (val <<3 )+ OCTVALUE (c );
1105- CopyDonePeek (fp ,c , true/*pick up*/ );
1108+ CopyDonePeek (fp ,c , true/* pick up */ );
11061109}
11071110else
11081111{
11091112if (c == EOF )
11101113gotoendOfFile ;
1111- CopyDonePeek (fp ,c , false/*put back*/ );
1114+ CopyDonePeek (fp ,c , false/* put back */ );
11121115}
11131116}
11141117else
11151118{
11161119if (c == EOF )
11171120gotoendOfFile ;
1118- CopyDonePeek (fp ,c , false/*put back*/ );
1121+ CopyDonePeek (fp ,c , false/* put back */ );
11191122}
11201123c = val & 0377 ;
11211124}