OSDN Git Service

Fix error messages for FreeFile in COPY command.
authorItagaki Takahiro <itagaki.takahiro@gmail.com>
Mon, 7 Feb 2011 01:46:56 +0000 (10:46 +0900)
committerItagaki Takahiro <itagaki.takahiro@gmail.com>
Mon, 7 Feb 2011 01:46:56 +0000 (10:46 +0900)
They are extracted from COPY API patch.

suggested by Noah Misch

src/backend/commands/copy.c

index 841bf22..3350ca0 100644 (file)
@@ -1319,7 +1319,7 @@ DoCopyTo(CopyState cstate)
                if (FreeFile(cstate->copy_file))
                        ereport(ERROR,
                                        (errcode_for_file_access(),
-                                        errmsg("could not write to file \"%s\": %m",
+                                        errmsg("could not close file \"%s\": %m",
                                                        cstate->filename)));
        }
 }
@@ -2263,7 +2263,7 @@ CopyFrom(CopyState cstate)
                if (FreeFile(cstate->copy_file))
                        ereport(ERROR,
                                        (errcode_for_file_access(),
-                                        errmsg("could not read from file \"%s\": %m",
+                                        errmsg("could not close file \"%s\": %m",
                                                        cstate->filename)));
        }