Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Greenplum
Gpdb
提交
8dc42a3a
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,发现更多精彩内容 >>
提交
8dc42a3a
编写于
4月 25, 2001
作者:
P
Philip Warner
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
- Fixed CONSTRAINT TRIGGER dump to record tgconstrelid properly
- pgsql v7.0 compatbility
上级
38b0f2fb
变更
8
展开全部
隐藏空白更改
内联
并排
Showing
8 changed file
with
370 addition
and
73 deletion
+370
-73
src/bin/pg_dump/pg_backup.h
src/bin/pg_dump/pg_backup.h
+9
-2
src/bin/pg_dump/pg_backup_archiver.c
src/bin/pg_dump/pg_backup_archiver.c
+20
-2
src/bin/pg_dump/pg_backup_archiver.h
src/bin/pg_dump/pg_backup_archiver.h
+2
-2
src/bin/pg_dump/pg_backup_custom.c
src/bin/pg_dump/pg_backup_custom.c
+6
-2
src/bin/pg_dump/pg_backup_db.c
src/bin/pg_dump/pg_backup_db.c
+31
-7
src/bin/pg_dump/pg_backup_tar.c
src/bin/pg_dump/pg_backup_tar.c
+2
-1
src/bin/pg_dump/pg_dump.c
src/bin/pg_dump/pg_dump.c
+298
-56
src/bin/pg_dump/pg_dump.h
src/bin/pg_dump/pg_dump.h
+2
-1
未找到文件。
src/bin/pg_dump/pg_backup.h
浏览文件 @
8dc42a3a
...
...
@@ -15,7 +15,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_backup.h,v 1.1
0 2001/04/01 05:42:50
pjw Exp $
* $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_backup.h,v 1.1
1 2001/04/25 07:03:19
pjw Exp $
*
* Modifications - 28-Jun-2000 - pjw@rhyme.com.au
*
...
...
@@ -50,6 +50,9 @@
#define atooid(x) ((Oid) strtoul((x), NULL, 10))
#define oidcmp(x,y) ( ((x) < (y) ? -1 : ((x) > (y)) ? 1 : 0) )
#define oideq(x,y) ( (x) == (y) )
#define oidle(x,y) ( (x) <= (y) )
#define oidge(x,y) ( (x) >= (y) )
#define oidzero(x) ( (x) == 0 )
typedef
enum
_archiveFormat
{
...
...
@@ -66,7 +69,10 @@ typedef enum _archiveFormat
*/
typedef
struct
_Archive
{
int
verbose
;
int
verbose
;
int
remoteVersion
;
int
minRemoteVersion
;
int
maxRemoteVersion
;
/* The rest is private */
}
Archive
;
...
...
@@ -115,6 +121,7 @@ typedef struct _restoreOptions
int
limitToList
;
int
compression
;
int
suppressDumpWarnings
;
/* Suppress output of WARNING entries to stderr */
}
RestoreOptions
;
/*
...
...
src/bin/pg_dump/pg_backup_archiver.c
浏览文件 @
8dc42a3a
...
...
@@ -15,7 +15,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_backup_archiver.c,v 1.2
4 2001/04/14 13:11:03
pjw Exp $
* $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_backup_archiver.c,v 1.2
5 2001/04/25 07:03:19
pjw Exp $
*
* Modifications - 28-Jun-2000 - pjw@rhyme.com.au
*
...
...
@@ -169,6 +169,10 @@ RestoreArchive(Archive *AHX, RestoreOptions *ropt)
if
(
AH
->
version
<
K_VERS_1_3
)
die_horribly
(
AH
,
"Direct database connections are not supported in pre-1.3 archives"
);
/* XXX Should get this from the archive */
AHX
->
minRemoteVersion
=
070100
;
AHX
->
maxRemoteVersion
=
999999
;
ConnectDatabase
(
AHX
,
ropt
->
dbname
,
ropt
->
pghost
,
ropt
->
pgport
,
ropt
->
requirePassword
,
ropt
->
ignoreVersion
);
...
...
@@ -260,6 +264,18 @@ RestoreArchive(Archive *AHX, RestoreOptions *ropt)
/* Work out what, if anything, we want from this entry */
reqs
=
_tocEntryRequired
(
te
,
ropt
);
/* Dump any relevant dump warnings to stderr */
if
(
!
ropt
->
suppressDumpWarnings
&&
strcmp
(
te
->
desc
,
"WARNING"
)
==
0
)
{
if
(
!
ropt
->
dataOnly
&&
te
->
defn
!=
NULL
&&
strlen
(
te
->
defn
)
!=
0
)
{
fprintf
(
stderr
,
"%s: Warning from original dump file:
\n
%s
\n
"
,
progname
,
te
->
defn
);
}
else
if
(
te
->
copyStmt
!=
NULL
&&
strlen
(
te
->
copyStmt
)
!=
0
)
{
fprintf
(
stderr
,
"%s: Warning from original dump file:
\n
%s
\n
"
,
progname
,
te
->
copyStmt
);
}
}
if
((
reqs
&
1
)
!=
0
)
/* We want the schema */
{
/* Reconnect if necessary */
...
...
@@ -405,6 +421,7 @@ NewRestoreOptions(void)
opts
=
(
RestoreOptions
*
)
calloc
(
1
,
sizeof
(
RestoreOptions
));
opts
->
format
=
archUnknown
;
opts
->
suppressDumpWarnings
=
false
;
return
opts
;
}
...
...
@@ -1419,7 +1436,8 @@ _discoverArchiveFormat(ArchiveHandle *AH)
cnt
=
fread
(
sig
,
1
,
5
,
fh
);
if
(
cnt
!=
5
)
die_horribly
(
AH
,
"%s: input file is too short, or is unreadable
\n
"
,
progname
);
die_horribly
(
AH
,
"%s: input file is too short, or is unreadable (read %d, expected 5)
\n
"
,
progname
,
cnt
);
/* Save it, just in case we need it later */
strncpy
(
&
AH
->
lookahead
[
0
],
sig
,
5
);
...
...
src/bin/pg_dump/pg_backup_archiver.h
浏览文件 @
8dc42a3a
...
...
@@ -17,7 +17,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_backup_archiver.h,v 1.3
1 2001/04/14 13:11:03
pjw Exp $
* $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_backup_archiver.h,v 1.3
2 2001/04/25 07:03:19
pjw Exp $
*
* Modifications - 28-Jun-2000 - pjw@rhyme.com.au
* - Initial version.
...
...
@@ -68,7 +68,7 @@ typedef z_stream *z_streamp;
#define K_VERS_MAJOR 1
#define K_VERS_MINOR 5
#define K_VERS_REV
3
#define K_VERS_REV
5
/* Data block types */
#define BLK_DATA 1
...
...
src/bin/pg_dump/pg_backup_custom.c
浏览文件 @
8dc42a3a
...
...
@@ -19,7 +19,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_backup_custom.c,v 1.1
0 2001/04/01 05:42:51
pjw Exp $
* $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_backup_custom.c,v 1.1
1 2001/04/25 07:03:19
pjw Exp $
*
* Modifications - 28-Jun-2000 - pjw@rhyme.com.au
*
...
...
@@ -786,6 +786,7 @@ _ReadBuf(ArchiveHandle *AH, void *buf, int len)
res
=
fread
(
buf
,
1
,
len
,
AH
->
FH
);
ctx
->
filePos
+=
res
;
return
res
;
}
...
...
@@ -854,7 +855,10 @@ _getFilePos(ArchiveHandle *AH, lclContext *ctx)
{
pos
=
ftell
(
AH
->
FH
);
if
(
pos
!=
ctx
->
filePos
)
fprintf
(
stderr
,
"Warning: ftell mismatch with filePos
\n
"
);
{
fprintf
(
stderr
,
"Warning: ftell mismatch with filePos - filePos used
\n
"
);
pos
=
ctx
->
filePos
;
}
}
else
pos
=
ctx
->
filePos
;
...
...
src/bin/pg_dump/pg_backup_db.c
浏览文件 @
8dc42a3a
...
...
@@ -5,7 +5,7 @@
* Implements the basic DB functions used by the archiver.
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_backup_db.c,v 1.1
7 2001/03/23 04:49:55 momjian
Exp $
* $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_backup_db.c,v 1.1
8 2001/04/25 07:03:19 pjw
Exp $
*
* NOTES
*
...
...
@@ -114,17 +114,36 @@ _prompt_for_password(char *username, char *password)
fprintf
(
stderr
,
"
\n\n
"
);
}
static
int
_parse_version
(
ArchiveHandle
*
AH
,
const
char
*
versionString
)
{
int
cnt
;
int
vmaj
,
vmin
,
vrev
;
cnt
=
sscanf
(
versionString
,
"%d.%d.%d"
,
&
vmaj
,
&
vmin
,
&
vrev
);
if
(
cnt
<
2
)
{
die_horribly
(
AH
,
"Unable to parse version string: %s
\n
"
,
versionString
);
}
if
(
cnt
==
2
)
vrev
=
0
;
return
(
100
*
vmaj
+
vmin
)
*
100
+
vrev
;
}
static
void
_check_database_version
(
ArchiveHandle
*
AH
,
bool
ignoreVersion
)
{
PGresult
*
res
;
double
myversion
;
int
myversion
;
const
char
*
remoteversion_str
;
double
remoteversion
;
int
remoteversion
;
PGconn
*
conn
=
AH
->
connection
;
myversion
=
strtod
(
PG_VERSION
,
NULL
);
myversion
=
_parse_version
(
AH
,
PG_VERSION
);
res
=
PQexec
(
conn
,
"SELECT version()"
);
if
(
!
res
||
PQresultStatus
(
res
)
!=
PGRES_TUPLES_OK
||
...
...
@@ -134,8 +153,14 @@ _check_database_version(ArchiveHandle *AH, bool ignoreVersion)
"Explanation from backend: '%s'.
\n
"
,
PQerrorMessage
(
conn
));
remoteversion_str
=
PQgetvalue
(
res
,
0
,
0
);
remoteversion
=
strtod
(
remoteversion_str
+
11
,
NULL
);
if
(
myversion
!=
remoteversion
)
remoteversion
=
_parse_version
(
AH
,
remoteversion_str
+
11
);
PQclear
(
res
);
AH
->
public
.
remoteVersion
=
remoteversion
;
if
(
myversion
!=
remoteversion
&&
(
remoteversion
<
AH
->
public
.
minRemoteVersion
||
remoteversion
>
AH
->
public
.
maxRemoteVersion
)
)
{
fprintf
(
stderr
,
"Database version: %s
\n
%s version: %s
\n
"
,
remoteversion_str
,
progname
,
PG_VERSION
);
...
...
@@ -145,7 +170,6 @@ _check_database_version(ArchiveHandle *AH, bool ignoreVersion)
die_horribly
(
AH
,
"Aborting because of version mismatch.
\n
"
"Use --ignore-version if you think it's safe to proceed anyway.
\n
"
);
}
PQclear
(
res
);
}
/*
...
...
src/bin/pg_dump/pg_backup_tar.c
浏览文件 @
8dc42a3a
...
...
@@ -16,7 +16,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_backup_tar.c,v 1.1
4 2001/04/14 13:11:03
pjw Exp $
* $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_backup_tar.c,v 1.1
5 2001/04/25 07:03:19
pjw Exp $
*
* Modifications - 28-Jun-2000 - pjw@rhyme.com.au
*
...
...
@@ -834,6 +834,7 @@ _CloseArchive(ArchiveHandle *AH)
ropt
->
dropSchema
=
1
;
ropt
->
compression
=
0
;
ropt
->
superuser
=
PQuser
(
AH
->
connection
);
ropt
->
suppressDumpWarnings
=
true
;
savVerbose
=
AH
->
public
.
verbose
;
AH
->
public
.
verbose
=
0
;
...
...
src/bin/pg_dump/pg_dump.c
浏览文件 @
8dc42a3a
此差异已折叠。
点击以展开。
src/bin/pg_dump/pg_dump.h
浏览文件 @
8dc42a3a
...
...
@@ -6,7 +6,7 @@
* Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* $Id: pg_dump.h,v 1.6
2 2001/04/14 13:11:03
pjw Exp $
* $Id: pg_dump.h,v 1.6
3 2001/04/25 07:03:20
pjw Exp $
*
* Modifications - 6/12/96 - dave@bensoft.com - version 1.13.dhb.2
*
...
...
@@ -159,6 +159,7 @@ typedef struct _aggInfo
char
*
aggbasetype
;
char
*
agginitval
;
char
*
usename
;
int
convertok
;
/* Flag to indicate of version convertsion is OK */
}
AggInfo
;
typedef
struct
_oprInfo
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录