Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Postgres FD Implementation
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Abuhujair Javed
Postgres FD Implementation
Commits
f9f90b21
Commit
f9f90b21
authored
May 22, 1999
by
Tom Lane
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improve error message from failed LOAD command (include
kernel's error description when file is not accessible).
parent
b21005fa
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
18 deletions
+12
-18
src/backend/tcop/utility.c
src/backend/tcop/utility.c
+3
-13
src/backend/utils/fmgr/dfmgr.c
src/backend/utils/fmgr/dfmgr.c
+9
-5
No files found.
src/backend/tcop/utility.c
View file @
f9f90b21
...
...
@@ -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
;
...
...
src/backend/utils/fmgr/dfmgr.c
View file @
f9f90b21
...
...
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/utils/fmgr/dfmgr.c,v 1.2
4 1999/05/10 00:46:13 momjian
Exp $
* $Header: /cvsroot/pgsql/src/backend/utils/fmgr/dfmgr.c,v 1.2
5 1999/05/22 19:49:41 tgl
Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -148,7 +148,7 @@ handle_load(char *filename, char *funcname)
if
(
file_scanner
==
(
DynamicFileList
*
)
NULL
)
{
if
(
stat
(
filename
,
&
stat_buf
)
==
-
1
)
elog
(
ERROR
,
"stat failed on file
%s
"
,
filename
);
elog
(
ERROR
,
"stat failed on file
'%s': %m
"
,
filename
);
for
(
file_scanner
=
file_list
;
file_scanner
!=
(
DynamicFileList
*
)
NULL
...
...
@@ -237,13 +237,17 @@ void
load_file
(
char
*
filename
)
{
DynamicFileList
*
file_scanner
,
*
p
;
*
p
;
struct
stat
stat_buf
;
int
done
=
0
;
/*
* We need to do stat() in order to determine whether this is the
* same file as a previously loaded file; it's also handy so as to
* give a good error message if bogus file name given.
*/
if
(
stat
(
filename
,
&
stat_buf
)
==
-
1
)
elog
(
ERROR
,
"
stat failed on file %s
"
,
filename
);
elog
(
ERROR
,
"
LOAD: could not open file '%s': %m
"
,
filename
);
if
(
file_list
!=
(
DynamicFileList
*
)
NULL
&&
!
NOT_EQUAL
(
stat_buf
,
*
file_list
))
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment