From f9f90b21b2d6675fe55e97cc85c2e952b475f1f4 Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Sat, 22 May 1999 19:49:42 +0000 Subject: Improve error message from failed LOAD command (include kernel's error description when file is not accessible). --- src/backend/tcop/utility.c | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) (limited to 'src/backend/tcop') diff --git a/src/backend/tcop/utility.c b/src/backend/tcop/utility.c index 0df4bf2641..a7fb1ed3a3 100644 --- a/src/backend/tcop/utility.c +++ b/src/backend/tcop/utility.c @@ -9,7 +9,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/tcop/utility.c,v 1.59 1999/03/17 22:53:19 momjian Exp $ + * $Header: /cvsroot/pgsql/src/backend/tcop/utility.c,v 1.60 1999/05/22 19:49:42 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -612,22 +612,12 @@ ProcessUtility(Node *parsetree, case T_LoadStmt: { LoadStmt *stmt = (LoadStmt *) parsetree; - FILE *fp; - char *filename; PS_SET_STATUS(commandTag = "LOAD"); CHECK_IF_ABORTED(); - filename = stmt->filename; - closeAllVfds(); -#ifndef __CYGWIN32__ - if ((fp = AllocateFile(filename, "r")) == NULL) -#else - if ((fp = AllocateFile(filename, "rb")) == NULL) -#endif - elog(ERROR, "LOAD: could not open file '%s'", filename); - FreeFile(fp); - load_file(filename); + closeAllVfds(); /* probably not necessary... */ + load_file(stmt->filename); } break; -- cgit v1.2.1