Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Greenplum
Gpdb
提交
8af787ea
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,发现更多精彩内容 >>
提交
8af787ea
编写于
7月 25, 2010
作者:
B
Bruce Momjian
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Adjust check_for_isn_and_int8_passing_mismatch() so it is called for all
migrations. Backpatch to 9.0.
上级
f31b1fd7
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
98 addition
and
98 deletion
+98
-98
contrib/pg_upgrade/check.c
contrib/pg_upgrade/check.c
+96
-2
contrib/pg_upgrade/pg_upgrade.h
contrib/pg_upgrade/pg_upgrade.h
+1
-3
contrib/pg_upgrade/version_old_8_3.c
contrib/pg_upgrade/version_old_8_3.c
+1
-93
未找到文件。
contrib/pg_upgrade/check.c
浏览文件 @
8af787ea
...
...
@@ -4,7 +4,7 @@
* server checks and output routines
*
* Copyright (c) 2010, PostgreSQL Global Development Group
* $PostgreSQL: pgsql/contrib/pg_upgrade/check.c,v 1.1
3 2010/07/25 03:28:32
momjian Exp $
* $PostgreSQL: pgsql/contrib/pg_upgrade/check.c,v 1.1
4 2010/07/25 03:47:29
momjian Exp $
*/
#include "pg_upgrade.h"
...
...
@@ -14,6 +14,8 @@ static void set_locale_and_encoding(migratorContext *ctx, Cluster whichCluster);
static
void
check_new_db_is_empty
(
migratorContext
*
ctx
);
static
void
check_locale_and_encoding
(
migratorContext
*
ctx
,
ControlData
*
oldctrl
,
ControlData
*
newctrl
);
static
void
check_for_isn_and_int8_passing_mismatch
(
migratorContext
*
ctx
,
Cluster
whichCluster
);
static
void
check_for_reg_data_type_usage
(
migratorContext
*
ctx
,
Cluster
whichCluster
);
...
...
@@ -63,11 +65,11 @@ check_old_cluster(migratorContext *ctx, bool live_check,
*/
check_for_reg_data_type_usage
(
ctx
,
CLUSTER_OLD
);
check_for_isn_and_int8_passing_mismatch
(
ctx
,
CLUSTER_OLD
);
/* old = PG 8.3 checks? */
if
(
GET_MAJOR_VERSION
(
ctx
->
old
.
major_version
)
<=
803
)
{
old_8_3_check_for_isn_and_int8_passing_mismatch
(
ctx
,
CLUSTER_OLD
);
old_8_3_check_for_name_data_type_usage
(
ctx
,
CLUSTER_OLD
);
old_8_3_check_for_tsquery_usage
(
ctx
,
CLUSTER_OLD
);
if
(
ctx
->
check
)
...
...
@@ -443,6 +445,98 @@ create_script_for_old_cluster_deletion(migratorContext *ctx,
}
/*
* check_for_isn_and_int8_passing_mismatch()
*
* /contrib/isn relies on data type int8, and in 8.4 int8 can now be passed
* by value. The schema dumps the CREATE TYPE PASSEDBYVALUE setting so
* it must match for the old and new servers.
*/
void
check_for_isn_and_int8_passing_mismatch
(
migratorContext
*
ctx
,
Cluster
whichCluster
)
{
ClusterInfo
*
active_cluster
=
(
whichCluster
==
CLUSTER_OLD
)
?
&
ctx
->
old
:
&
ctx
->
new
;
int
dbnum
;
FILE
*
script
=
NULL
;
bool
found
=
false
;
char
output_path
[
MAXPGPATH
];
prep_status
(
ctx
,
"Checking for /contrib/isn with bigint-passing mismatch"
);
if
(
ctx
->
old
.
controldata
.
float8_pass_by_value
==
ctx
->
new
.
controldata
.
float8_pass_by_value
)
{
/* no mismatch */
check_ok
(
ctx
);
return
;
}
snprintf
(
output_path
,
sizeof
(
output_path
),
"%s/contrib_isn_and_int8_pass_by_value.txt"
,
ctx
->
cwd
);
for
(
dbnum
=
0
;
dbnum
<
active_cluster
->
dbarr
.
ndbs
;
dbnum
++
)
{
PGresult
*
res
;
bool
db_used
=
false
;
int
ntups
;
int
rowno
;
int
i_nspname
,
i_proname
;
DbInfo
*
active_db
=
&
active_cluster
->
dbarr
.
dbs
[
dbnum
];
PGconn
*
conn
=
connectToServer
(
ctx
,
active_db
->
db_name
,
whichCluster
);
/* Find any functions coming from contrib/isn */
res
=
executeQueryOrDie
(
ctx
,
conn
,
"SELECT n.nspname, p.proname "
"FROM pg_catalog.pg_proc p, "
" pg_catalog.pg_namespace n "
"WHERE p.pronamespace = n.oid AND "
" p.probin = '$libdir/isn'"
);
ntups
=
PQntuples
(
res
);
i_nspname
=
PQfnumber
(
res
,
"nspname"
);
i_proname
=
PQfnumber
(
res
,
"proname"
);
for
(
rowno
=
0
;
rowno
<
ntups
;
rowno
++
)
{
found
=
true
;
if
(
script
==
NULL
&&
(
script
=
fopen
(
output_path
,
"w"
))
==
NULL
)
pg_log
(
ctx
,
PG_FATAL
,
"Could not create necessary file: %s
\n
"
,
output_path
);
if
(
!
db_used
)
{
fprintf
(
script
,
"Database: %s
\n
"
,
active_db
->
db_name
);
db_used
=
true
;
}
fprintf
(
script
,
" %s.%s
\n
"
,
PQgetvalue
(
res
,
rowno
,
i_nspname
),
PQgetvalue
(
res
,
rowno
,
i_proname
));
}
PQclear
(
res
);
PQfinish
(
conn
);
}
if
(
found
)
{
fclose
(
script
);
pg_log
(
ctx
,
PG_REPORT
,
"fatal
\n
"
);
pg_log
(
ctx
,
PG_FATAL
,
"| Your installation contains
\"
/contrib/isn
\"
functions
\n
"
"| which rely on the bigint data type. Your old and
\n
"
"| new clusters pass bigint values differently so this
\n
"
"| cluster cannot currently be upgraded. You can
\n
"
"| manually migrate data that use
\"
/contrib/isn
\"\n
"
"| facilities and remove
\"
/contrib/isn
\"
from the
\n
"
"| old cluster and restart the migration. A list
\n
"
"| of the problem functions is in the file:
\n
"
"|
\t
%s
\n\n
"
,
output_path
);
}
else
check_ok
(
ctx
);
}
/*
* check_for_reg_data_type_usage()
* pg_upgrade only preserves these system values:
...
...
contrib/pg_upgrade/pg_upgrade.h
浏览文件 @
8af787ea
...
...
@@ -2,7 +2,7 @@
* pg_upgrade.h
*
* Copyright (c) 2010, PostgreSQL Global Development Group
* $PostgreSQL: pgsql/contrib/pg_upgrade/pg_upgrade.h,v 1.1
5 2010/07/06 19:18:55
momjian Exp $
* $PostgreSQL: pgsql/contrib/pg_upgrade/pg_upgrade.h,v 1.1
6 2010/07/25 03:47:29
momjian Exp $
*/
#include "postgres.h"
...
...
@@ -388,8 +388,6 @@ void old_8_3_check_for_name_data_type_usage(migratorContext *ctx,
Cluster
whichCluster
);
void
old_8_3_check_for_tsquery_usage
(
migratorContext
*
ctx
,
Cluster
whichCluster
);
void
old_8_3_check_for_isn_and_int8_passing_mismatch
(
migratorContext
*
ctx
,
Cluster
whichCluster
);
void
old_8_3_rebuild_tsvector_tables
(
migratorContext
*
ctx
,
bool
check_mode
,
Cluster
whichCluster
);
void
old_8_3_invalidate_hash_gin_indexes
(
migratorContext
*
ctx
,
...
...
contrib/pg_upgrade/version_old_8_3.c
浏览文件 @
8af787ea
...
...
@@ -4,7 +4,7 @@
* Postgres-version-specific routines
*
* Copyright (c) 2010, PostgreSQL Global Development Group
* $PostgreSQL: pgsql/contrib/pg_upgrade/version_old_8_3.c,v 1.
7 2010/07/25 03:28:32
momjian Exp $
* $PostgreSQL: pgsql/contrib/pg_upgrade/version_old_8_3.c,v 1.
8 2010/07/25 03:47:29
momjian Exp $
*/
#include "pg_upgrade.h"
...
...
@@ -197,98 +197,6 @@ old_8_3_check_for_tsquery_usage(migratorContext *ctx, Cluster whichCluster)
}
/*
* old_8_3_check_for_isn_and_int8_passing_mismatch()
* 8.3 -> 8.4
* /contrib/isn relies on data type int8, and in 8.4 int8 is now passed
* by value. The schema dumps the CREATE TYPE PASSEDBYVALUE setting so
* it must match for the old and new servers.
*/
void
old_8_3_check_for_isn_and_int8_passing_mismatch
(
migratorContext
*
ctx
,
Cluster
whichCluster
)
{
ClusterInfo
*
active_cluster
=
(
whichCluster
==
CLUSTER_OLD
)
?
&
ctx
->
old
:
&
ctx
->
new
;
int
dbnum
;
FILE
*
script
=
NULL
;
bool
found
=
false
;
char
output_path
[
MAXPGPATH
];
prep_status
(
ctx
,
"Checking for /contrib/isn with bigint-passing mismatch"
);
if
(
ctx
->
old
.
controldata
.
float8_pass_by_value
==
ctx
->
new
.
controldata
.
float8_pass_by_value
)
{
/* no mismatch */
check_ok
(
ctx
);
return
;
}
snprintf
(
output_path
,
sizeof
(
output_path
),
"%s/contrib_isn_and_int8_pass_by_value.txt"
,
ctx
->
cwd
);
for
(
dbnum
=
0
;
dbnum
<
active_cluster
->
dbarr
.
ndbs
;
dbnum
++
)
{
PGresult
*
res
;
bool
db_used
=
false
;
int
ntups
;
int
rowno
;
int
i_nspname
,
i_proname
;
DbInfo
*
active_db
=
&
active_cluster
->
dbarr
.
dbs
[
dbnum
];
PGconn
*
conn
=
connectToServer
(
ctx
,
active_db
->
db_name
,
whichCluster
);
/* Find any functions coming from contrib/isn */
res
=
executeQueryOrDie
(
ctx
,
conn
,
"SELECT n.nspname, p.proname "
"FROM pg_catalog.pg_proc p, "
" pg_catalog.pg_namespace n "
"WHERE p.pronamespace = n.oid AND "
" p.probin = '$libdir/isn'"
);
ntups
=
PQntuples
(
res
);
i_nspname
=
PQfnumber
(
res
,
"nspname"
);
i_proname
=
PQfnumber
(
res
,
"proname"
);
for
(
rowno
=
0
;
rowno
<
ntups
;
rowno
++
)
{
found
=
true
;
if
(
script
==
NULL
&&
(
script
=
fopen
(
output_path
,
"w"
))
==
NULL
)
pg_log
(
ctx
,
PG_FATAL
,
"Could not create necessary file: %s
\n
"
,
output_path
);
if
(
!
db_used
)
{
fprintf
(
script
,
"Database: %s
\n
"
,
active_db
->
db_name
);
db_used
=
true
;
}
fprintf
(
script
,
" %s.%s
\n
"
,
PQgetvalue
(
res
,
rowno
,
i_nspname
),
PQgetvalue
(
res
,
rowno
,
i_proname
));
}
PQclear
(
res
);
PQfinish
(
conn
);
}
if
(
found
)
{
fclose
(
script
);
pg_log
(
ctx
,
PG_REPORT
,
"fatal
\n
"
);
pg_log
(
ctx
,
PG_FATAL
,
"| Your installation contains
\"
/contrib/isn
\"
functions
\n
"
"| which rely on the bigint data type. Your old and
\n
"
"| new clusters pass bigint values differently so this
\n
"
"| cluster cannot currently be upgraded. You can
\n
"
"| manually migrate data that use
\"
/contrib/isn
\"\n
"
"| facilities and remove
\"
/contrib/isn
\"
from the
\n
"
"| old cluster and restart the migration. A list
\n
"
"| of the problem functions is in the file:
\n
"
"|
\t
%s
\n\n
"
,
output_path
);
}
else
check_ok
(
ctx
);
}
/*
* old_8_3_rebuild_tsvector_tables()
* 8.3 -> 8.4
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录