Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Greenplum
Gpdb
提交
ed8aa971
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,发现更多精彩内容 >>
提交
ed8aa971
编写于
4月 24, 2002
作者:
P
Peter Eisentraut
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Remove references to NAMEDATALEN and INDEX_MAX_KEYS from pg_dump. Handles
any size now.
上级
8889eb09
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
26 addition
and
15 deletion
+26
-15
src/bin/pg_dump/pg_dump.c
src/bin/pg_dump/pg_dump.c
+22
-12
src/bin/pg_dump/pg_dump.h
src/bin/pg_dump/pg_dump.h
+4
-3
未找到文件。
src/bin/pg_dump/pg_dump.c
浏览文件 @
ed8aa971
...
...
@@ -22,7 +22,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_dump.c,v 1.25
4 2002/04/24 02:44:19 momjian
Exp $
* $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_dump.c,v 1.25
5 2002/04/24 22:39:49 petere
Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -1802,10 +1802,12 @@ clearIndInfo(IndInfo *ind, int numIndexes)
free
(
ind
[
i
].
indexdef
);
if
(
ind
[
i
].
indisprimary
)
free
(
ind
[
i
].
indisprimary
);
for
(
a
=
0
;
a
<
INDEX_MAX_KEYS
;
++
a
)
if
(
ind
[
i
].
indkey
)
{
if
(
ind
[
i
].
indkey
[
a
])
free
(
ind
[
i
].
indkey
[
a
]);
for
(
a
=
0
;
a
<
ind
[
i
].
indnkeys
;
++
a
)
if
(
ind
[
i
].
indkey
[
a
])
free
(
ind
[
i
].
indkey
[
a
]);
free
(
ind
[
i
].
indkey
);
}
}
free
(
ind
);
...
...
@@ -3020,6 +3022,7 @@ getIndexes(int *numIndexes)
int
i_indrelname
;
int
i_indexdef
;
int
i_indisprimary
;
int
i_indnkeys
;
int
i_indkey
;
/*
...
...
@@ -3033,11 +3036,14 @@ getIndexes(int *numIndexes)
appendPQExpBuffer
(
query
,
"SELECT i.indexrelid as indexreloid, "
"i.indrelid as indreloid, "
"t1.relname as indexrelname, t2.relname as indrelname, "
"t1.relname as indexrelname, t2.relname as indrelname, "
"pg_get_indexdef(i.indexrelid) as indexdef, "
"i.indisprimary, i.indkey "
"from pg_index i, pg_class t1, pg_class t2 "
"WHERE t1.oid = i.indexrelid and t2.oid = i.indrelid "
"i.indisprimary, i.indkey, "
"CASE WHEN regproctooid(i.indproc) <> 0 "
" THEN (SELECT pronargs FROM pg_proc WHERE pg_proc.oid = regproctooid(i.indproc)) "
" ELSE t1.relnatts END as indnkeys "
"FROM pg_index i, pg_class t1, pg_class t2 "
"WHERE t1.oid = i.indexrelid and t2.oid = i.indrelid "
"and i.indexrelid > '%u'::oid "
"and t2.relname !~ '^pg_' "
,
g_last_builtin_oid
);
...
...
@@ -3067,6 +3073,7 @@ getIndexes(int *numIndexes)
i_indrelname
=
PQfnumber
(
res
,
"indrelname"
);
i_indexdef
=
PQfnumber
(
res
,
"indexdef"
);
i_indisprimary
=
PQfnumber
(
res
,
"indisprimary"
);
i_indnkeys
=
PQfnumber
(
res
,
"indnkeys"
);
i_indkey
=
PQfnumber
(
res
,
"indkey"
);
for
(
i
=
0
;
i
<
ntups
;
i
++
)
...
...
@@ -3077,9 +3084,11 @@ getIndexes(int *numIndexes)
indinfo
[
i
].
indrelname
=
strdup
(
PQgetvalue
(
res
,
i
,
i_indrelname
));
indinfo
[
i
].
indexdef
=
strdup
(
PQgetvalue
(
res
,
i
,
i_indexdef
));
indinfo
[
i
].
indisprimary
=
strdup
(
PQgetvalue
(
res
,
i
,
i_indisprimary
));
indinfo
[
i
].
indnkeys
=
atoi
(
PQgetvalue
(
res
,
i
,
i_indnkeys
));
indinfo
[
i
].
indkey
=
malloc
(
indinfo
[
i
].
indnkeys
*
sizeof
(
indinfo
[
i
].
indkey
[
0
]));
parseNumericArray
(
PQgetvalue
(
res
,
i
,
i_indkey
),
indinfo
[
i
].
indkey
,
INDEX_MAX_KEYS
);
indinfo
[
i
].
indnkeys
);
}
PQclear
(
res
);
...
...
@@ -3577,7 +3586,7 @@ dumpOneFunc(Archive *fout, FuncInfo *finfo, int i,
PQExpBuffer
delqry
=
createPQExpBuffer
();
PQExpBuffer
fnlist
=
createPQExpBuffer
();
PQExpBuffer
asPart
=
createPQExpBuffer
();
char
func_lang
[
NAMEDATALEN
+
1
]
;
char
*
func_lang
=
NULL
;
PGresult
*
res
;
int
nlangs
;
int
j
;
...
...
@@ -3638,7 +3647,7 @@ dumpOneFunc(Archive *fout, FuncInfo *finfo, int i,
}
}
strcpy
(
func_lang
,
PQgetvalue
(
res
,
0
,
i_lanname
));
func_lang
=
strdup
(
PQgetvalue
(
res
,
0
,
i_lanname
));
PQclear
(
res
);
...
...
@@ -3749,6 +3758,7 @@ done:
destroyPQExpBuffer
(
delqry
);
destroyPQExpBuffer
(
fnlist
);
destroyPQExpBuffer
(
asPart
);
free
(
func_lang
);
}
/*
...
...
@@ -4515,7 +4525,7 @@ getPKconstraint(TableInfo *tblInfo, IndInfo *indInfo)
appendPQExpBuffer
(
pkBuf
,
"Constraint %s Primary Key ("
,
tblInfo
->
primary_key_name
);
for
(
k
=
0
;
k
<
INDEX_MAX_KEYS
;
k
++
)
for
(
k
=
0
;
k
<
indInfo
->
indnkeys
;
k
++
)
{
int
indkey
;
const
char
*
attname
;
...
...
src/bin/pg_dump/pg_dump.h
浏览文件 @
ed8aa971
...
...
@@ -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.8
3 2002/04/24 02:44:19 momjian
Exp $
* $Id: pg_dump.h,v 1.8
4 2002/04/24 22:39:49 petere
Exp $
*
* Modifications - 6/12/96 - dave@bensoft.com - version 1.13.dhb.2
*
...
...
@@ -148,8 +148,9 @@ typedef struct _indInfo
char
*
indrelname
;
/* name of the indexed table */
char
*
indexdef
;
/* index definitional command */
char
*
indisprimary
;
/* is this a PK index? */
char
*
indkey
[
INDEX_MAX_KEYS
];
/* attribute numbers of the key
* attributes */
int
indnkeys
;
/* number of keys in index */
char
**
indkey
;
/* attribute numbers of the key
* attributes */
}
IndInfo
;
typedef
struct
_aggInfo
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录