Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Greenplum
Gpdb
提交
79e37103
G
Gpdb
项目概览
Greenplum
/
Gpdb
通知
7
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
G
Gpdb
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
79e37103
编写于
5月 22, 2006
作者:
P
Peter Eisentraut
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Add strerror to pg_dump error messages where missing.
上级
e9cc5302
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
51 addition
and
42 deletion
+51
-42
src/bin/pg_dump/common.c
src/bin/pg_dump/common.c
+3
-3
src/bin/pg_dump/pg_backup_archiver.c
src/bin/pg_dump/pg_backup_archiver.c
+11
-9
src/bin/pg_dump/pg_backup_custom.c
src/bin/pg_dump/pg_backup_custom.c
+23
-14
src/bin/pg_dump/pg_backup_files.c
src/bin/pg_dump/pg_backup_files.c
+5
-5
src/bin/pg_dump/pg_backup_tar.c
src/bin/pg_dump/pg_backup_tar.c
+5
-7
src/bin/pg_dump/pg_dumpall.c
src/bin/pg_dump/pg_dumpall.c
+4
-4
未找到文件。
src/bin/pg_dump/common.c
浏览文件 @
79e37103
...
...
@@ -11,7 +11,7 @@
*
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/bin/pg_dump/common.c,v 1.
89 2006/03/05 15:58:50 momjian
Exp $
* $PostgreSQL: pgsql/src/bin/pg_dump/common.c,v 1.
90 2006/05/22 11:21:54 petere
Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -768,7 +768,7 @@ parseOidArray(const char *str, Oid *array, int arraysize)
{
if
(
argNum
>=
arraysize
)
{
write_msg
(
NULL
,
"could not parse numeric array
: too many numbers
\n
"
);
write_msg
(
NULL
,
"could not parse numeric array
\"
%s
\"
: too many numbers
\n
"
,
str
);
exit_nicely
();
}
temp
[
j
]
=
'\0'
;
...
...
@@ -783,7 +783,7 @@ parseOidArray(const char *str, Oid *array, int arraysize)
if
(
!
(
isdigit
((
unsigned
char
)
s
)
||
s
==
'-'
)
||
j
>=
sizeof
(
temp
)
-
1
)
{
write_msg
(
NULL
,
"could not parse numeric array
: invalid character in number
\n
"
);
write_msg
(
NULL
,
"could not parse numeric array
\"
%s
\"
: invalid character in number
\n
"
,
str
);
exit_nicely
();
}
temp
[
j
++
]
=
s
;
...
...
src/bin/pg_dump/pg_backup_archiver.c
浏览文件 @
79e37103
...
...
@@ -15,7 +15,7 @@
*
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/bin/pg_dump/pg_backup_archiver.c,v 1.12
7 2006/04/19 16:02:17 tgl
Exp $
* $PostgreSQL: pgsql/src/bin/pg_dump/pg_backup_archiver.c,v 1.12
8 2006/05/22 11:21:54 petere
Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -122,7 +122,8 @@ CloseArchive(Archive *AHX)
res
=
fclose
(
AH
->
OF
);
if
(
res
!=
0
)
die_horribly
(
AH
,
modulename
,
"could not close output archive file
\n
"
);
die_horribly
(
AH
,
modulename
,
"could not close output file: %s
\n
"
,
strerror
(
errno
));
}
/* Public */
...
...
@@ -306,7 +307,7 @@ RestoreArchive(Archive *AHX, RestoreOptions *ropt)
{
#ifndef HAVE_LIBZ
if
(
AH
->
compression
!=
0
)
die_horribly
(
AH
,
modulename
,
"cannot restore from compressed archive (
not configured for compression support
)
\n
"
);
die_horribly
(
AH
,
modulename
,
"cannot restore from compressed archive (
compression not supported in this installation
)
\n
"
);
#endif
_printTocEntry
(
AH
,
te
,
ropt
,
true
,
false
);
...
...
@@ -774,7 +775,8 @@ SortTocFromFile(Archive *AHX, RestoreOptions *ropt)
/* Setup the file */
fh
=
fopen
(
ropt
->
tocFile
,
PG_BINARY_R
);
if
(
!
fh
)
die_horribly
(
AH
,
modulename
,
"could not open TOC file
\n
"
);
die_horribly
(
AH
,
modulename
,
"could not open TOC file: %s
\n
"
,
strerror
(
errno
));
while
(
fgets
(
buf
,
sizeof
(
buf
),
fh
)
!=
NULL
)
{
...
...
@@ -1066,7 +1068,7 @@ ahwrite(const void *ptr, size_t size, size_t nmemb, ArchiveHandle *AH)
{
res
=
GZWRITE
((
void
*
)
ptr
,
size
,
nmemb
,
AH
->
OF
);
if
(
res
!=
(
nmemb
*
size
))
die_horribly
(
AH
,
modulename
,
"could not write to
compressed archive
\n
"
);
die_horribly
(
AH
,
modulename
,
"could not write to
output file: %s
\n
"
,
strerror
(
errno
)
);
return
res
;
}
else
if
(
AH
->
CustomOutPtr
)
...
...
@@ -1089,8 +1091,8 @@ ahwrite(const void *ptr, size_t size, size_t nmemb, ArchiveHandle *AH)
{
res
=
fwrite
((
void
*
)
ptr
,
size
,
nmemb
,
AH
->
OF
);
if
(
res
!=
nmemb
)
die_horribly
(
AH
,
modulename
,
"could not write to output file
(%lu != %lu)
\n
"
,
(
unsigned
long
)
res
,
(
unsigned
long
)
nmemb
);
die_horribly
(
AH
,
modulename
,
"could not write to output file
: %s
\n
"
,
strerror
(
errno
)
);
return
res
;
}
}
...
...
@@ -1321,7 +1323,7 @@ ReadOffset(ArchiveHandle *AH, off_t *o)
break
;
default:
die_horribly
(
AH
,
modulename
,
"
U
nexpected data offset flag %d
\n
"
,
offsetFlg
);
die_horribly
(
AH
,
modulename
,
"
u
nexpected data offset flag %d
\n
"
,
offsetFlg
);
}
/*
...
...
@@ -1556,7 +1558,7 @@ _discoverArchiveFormat(ArchiveHandle *AH)
/* Close the file */
if
(
wantClose
)
if
(
fclose
(
fh
)
!=
0
)
die_horribly
(
AH
,
modulename
,
"could not close
the input file after reading header
: %s
\n
"
,
die_horribly
(
AH
,
modulename
,
"could not close
input file
: %s
\n
"
,
strerror
(
errno
));
return
AH
->
format
;
...
...
src/bin/pg_dump/pg_backup_custom.c
浏览文件 @
79e37103
...
...
@@ -19,7 +19,7 @@
*
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/bin/pg_dump/pg_backup_custom.c,v 1.3
3 2005/10/15 02:49:38 momjian
Exp $
* $PostgreSQL: pgsql/src/bin/pg_dump/pg_backup_custom.c,v 1.3
4 2006/05/22 11:21:54 petere
Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -175,7 +175,7 @@ InitArchiveFmt_Custom(ArchiveHandle *AH)
AH
->
FH
=
stdout
;
if
(
!
AH
->
FH
)
die_horribly
(
AH
,
modulename
,
"could not open
archive
file
\"
%s
\"
: %s
\n
"
,
AH
->
fSpec
,
strerror
(
errno
));
die_horribly
(
AH
,
modulename
,
"could not open
output
file
\"
%s
\"
: %s
\n
"
,
AH
->
fSpec
,
strerror
(
errno
));
ctx
->
hasSeek
=
checkSeek
(
AH
->
FH
);
}
...
...
@@ -186,7 +186,7 @@ InitArchiveFmt_Custom(ArchiveHandle *AH)
else
AH
->
FH
=
stdin
;
if
(
!
AH
->
FH
)
die_horribly
(
AH
,
modulename
,
"could not open
archive
file
\"
%s
\"
: %s
\n
"
,
AH
->
fSpec
,
strerror
(
errno
));
die_horribly
(
AH
,
modulename
,
"could not open
input
file
\"
%s
\"
: %s
\n
"
,
AH
->
fSpec
,
strerror
(
errno
));
ctx
->
hasSeek
=
checkSeek
(
AH
->
FH
);
...
...
@@ -438,7 +438,7 @@ _PrintTocData(ArchiveHandle *AH, TocEntry *te, RestoreOptions *ropt)
{
if
((
TocIDRequired
(
AH
,
id
,
ropt
)
&
REQ_DATA
)
!=
0
)
die_horribly
(
AH
,
modulename
,
"
D
umping a specific TOC data block out of order is not supported"
"
d
umping a specific TOC data block out of order is not supported"
" without ID on this input stream (fseek required)
\n
"
);
switch
(
blkType
)
...
...
@@ -540,9 +540,14 @@ _PrintData(ArchiveHandle *AH)
cnt
=
fread
(
in
,
1
,
blkLen
,
AH
->
FH
);
if
(
cnt
!=
blkLen
)
die_horribly
(
AH
,
modulename
,
"could not read data block -- expected %lu, got %lu
\n
"
,
(
unsigned
long
)
blkLen
,
(
unsigned
long
)
cnt
);
{
if
(
feof
(
AH
->
FH
))
die_horribly
(
AH
,
modulename
,
"could not read from input file: end of file
\n
"
);
else
die_horribly
(
AH
,
modulename
,
"could not read from input file: %s
\n
"
,
strerror
(
errno
));
}
ctx
->
filePos
+=
blkLen
;
...
...
@@ -663,9 +668,14 @@ _skipData(ArchiveHandle *AH)
}
cnt
=
fread
(
in
,
1
,
blkLen
,
AH
->
FH
);
if
(
cnt
!=
blkLen
)
die_horribly
(
AH
,
modulename
,
"could not read data block -- expected %lu, got %lu
\n
"
,
(
unsigned
long
)
blkLen
,
(
unsigned
long
)
cnt
);
{
if
(
feof
(
AH
->
FH
))
die_horribly
(
AH
,
modulename
,
"could not read from input file: end of file
\n
"
);
else
die_horribly
(
AH
,
modulename
,
"could not read from input file: %s
\n
"
,
strerror
(
errno
));
}
ctx
->
filePos
+=
blkLen
;
...
...
@@ -736,8 +746,7 @@ _WriteBuf(ArchiveHandle *AH, const void *buf, size_t len)
if
(
res
!=
len
)
die_horribly
(
AH
,
modulename
,
"write error in _WriteBuf (%lu != %lu)
\n
"
,
(
unsigned
long
)
res
,
(
unsigned
long
)
len
);
"could not write to output file: %s
\n
"
,
strerror
(
errno
));
ctx
->
filePos
+=
res
;
return
res
;
...
...
@@ -929,7 +938,7 @@ _DoDeflate(ArchiveHandle *AH, lclContext *ctx, int flush)
*/
WriteInt
(
AH
,
zlibOutSize
-
zp
->
avail_out
);
if
(
fwrite
(
out
,
1
,
zlibOutSize
-
zp
->
avail_out
,
AH
->
FH
)
!=
(
zlibOutSize
-
zp
->
avail_out
))
die_horribly
(
AH
,
modulename
,
"could not write
compressed chunk
\n
"
);
die_horribly
(
AH
,
modulename
,
"could not write
to output file: %s
\n
"
,
strerror
(
errno
)
);
ctx
->
filePos
+=
zlibOutSize
-
zp
->
avail_out
;
}
zp
->
next_out
=
(
void
*
)
out
;
...
...
@@ -943,7 +952,7 @@ _DoDeflate(ArchiveHandle *AH, lclContext *ctx, int flush)
{
WriteInt
(
AH
,
zp
->
avail_in
);
if
(
fwrite
(
zp
->
next_in
,
1
,
zp
->
avail_in
,
AH
->
FH
)
!=
zp
->
avail_in
)
die_horribly
(
AH
,
modulename
,
"could not write
uncompressed chunk
\n
"
);
die_horribly
(
AH
,
modulename
,
"could not write
to output file: %s
\n
"
,
strerror
(
errno
)
);
ctx
->
filePos
+=
zp
->
avail_in
;
zp
->
avail_in
=
0
;
}
...
...
src/bin/pg_dump/pg_backup_files.c
浏览文件 @
79e37103
...
...
@@ -20,7 +20,7 @@
*
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/bin/pg_dump/pg_backup_files.c,v 1.2
7 2005/10/15 02:49:38 momjian
Exp $
* $PostgreSQL: pgsql/src/bin/pg_dump/pg_backup_files.c,v 1.2
8 2006/05/22 11:21:54 petere
Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -243,7 +243,7 @@ _StartData(ArchiveHandle *AH, TocEntry *te)
#endif
if
(
tctx
->
FH
==
NULL
)
die_horribly
(
AH
,
modulename
,
"could not open
data file for output
\n
"
);
die_horribly
(
AH
,
modulename
,
"could not open
output file: %s
\n
"
,
strerror
(
errno
)
);
}
static
size_t
...
...
@@ -287,7 +287,7 @@ _PrintFileData(ArchiveHandle *AH, char *filename, RestoreOptions *ropt)
#endif
if
(
AH
->
FH
==
NULL
)
die_horribly
(
AH
,
modulename
,
"could not open
data file for input
\n
"
);
die_horribly
(
AH
,
modulename
,
"could not open
input file: %s
\n
"
,
strerror
(
errno
)
);
while
((
cnt
=
GZREAD
(
buf
,
1
,
4095
,
AH
->
FH
))
>
0
)
{
...
...
@@ -411,7 +411,7 @@ _WriteBuf(ArchiveHandle *AH, const void *buf, size_t len)
res
=
fwrite
(
buf
,
1
,
len
,
AH
->
FH
);
if
(
res
!=
len
)
die_horribly
(
AH
,
modulename
,
"
write error in _WriteBuf (%lu != %lu)
\n
"
,
(
unsigned
long
)
res
,
(
unsigned
long
)
len
);
die_horribly
(
AH
,
modulename
,
"
could not write to output file: %s
\n
"
,
strerror
(
errno
)
);
ctx
->
filePos
+=
res
;
return
res
;
...
...
@@ -508,7 +508,7 @@ _StartBlob(ArchiveHandle *AH, TocEntry *te, Oid oid)
#endif
if
(
tctx
->
FH
==
NULL
)
die_horribly
(
AH
,
modulename
,
"could not open large object file
\n
"
);
die_horribly
(
AH
,
modulename
,
"could not open large object file
for input: %s
\n
"
,
strerror
(
errno
)
);
}
/*
...
...
src/bin/pg_dump/pg_backup_tar.c
浏览文件 @
79e37103
...
...
@@ -16,7 +16,7 @@
*
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/bin/pg_dump/pg_backup_tar.c,v 1.5
0 2006/02/12 06:11:50 momjian
Exp $
* $PostgreSQL: pgsql/src/bin/pg_dump/pg_backup_tar.c,v 1.5
1 2006/05/22 11:21:54 petere
Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -546,8 +546,7 @@ tarWrite(const void *buf, size_t len, TAR_MEMBER *th)
if
(
res
!=
len
)
die_horribly
(
th
->
AH
,
modulename
,
"could not write to tar member (wrote %lu, attempted %lu)
\n
"
,
(
unsigned
long
)
res
,
(
unsigned
long
)
len
);
"could not write to output file: %s
\n
"
,
strerror
(
errno
));
th
->
pos
+=
res
;
return
res
;
...
...
@@ -1035,13 +1034,12 @@ _tarAddFile(ArchiveHandle *AH, TAR_MEMBER *th)
res
=
fwrite
(
&
buf
[
0
],
1
,
cnt
,
th
->
tarFH
);
if
(
res
!=
cnt
)
die_horribly
(
AH
,
modulename
,
"write error appending to tar archive (wrote %lu, attempted %lu)
\n
"
,
(
unsigned
long
)
res
,
(
unsigned
long
)
cnt
);
"could not write to output file: %s
\n
"
,
strerror
(
errno
));
len
+=
res
;
}
if
(
fclose
(
tmp
)
!=
0
)
/* This *should* delete it... */
die_horribly
(
AH
,
modulename
,
"could not close t
ar member
: %s
\n
"
,
strerror
(
errno
));
die_horribly
(
AH
,
modulename
,
"could not close t
emporary file
: %s
\n
"
,
strerror
(
errno
));
if
(
len
!=
th
->
fileLen
)
{
...
...
@@ -1327,6 +1325,6 @@ _tarWriteHeader(TAR_MEMBER *th)
}
if
(
fwrite
(
h
,
1
,
512
,
th
->
tarFH
)
!=
512
)
die_horribly
(
th
->
AH
,
modulename
,
"could not write t
ar header
\n
"
);
die_horribly
(
th
->
AH
,
modulename
,
"could not write t
o output file: %s
\n
"
,
strerror
(
errno
)
);
}
src/bin/pg_dump/pg_dumpall.c
浏览文件 @
79e37103
...
...
@@ -6,7 +6,7 @@
* Portions Copyright (c) 1994, Regents of the University of California
*
*
* $PostgreSQL: pgsql/src/bin/pg_dump/pg_dumpall.c,v 1.7
4 2006/04/07 21:26:29 tgl
Exp $
* $PostgreSQL: pgsql/src/bin/pg_dump/pg_dumpall.c,v 1.7
5 2006/05/22 11:21:54 petere
Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -38,8 +38,8 @@ int optreset;
#include "pqexpbuffer.h"
/* version string we expect back from p
ostgres
*/
#define PG_VERSIONSTR "pg_dump (PostgreSQL) " PG_VERSION "\n"
/* version string we expect back from p
g_dump
*/
#define PG
DUMP
_VERSIONSTR "pg_dump (PostgreSQL) " PG_VERSION "\n"
static
const
char
*
progname
;
...
...
@@ -142,7 +142,7 @@ main(int argc, char *argv[])
}
}
if
((
ret
=
find_other_exec
(
argv
[
0
],
"pg_dump"
,
PG_VERSIONSTR
,
if
((
ret
=
find_other_exec
(
argv
[
0
],
"pg_dump"
,
PG
DUMP
_VERSIONSTR
,
pg_dump_bin
))
<
0
)
{
char
full_path
[
MAXPGPATH
];
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录