提交 7ca0c9d6 编写于 作者: A Adam Berlin 提交者: Adam Berlin

Extract duplicated PGOPTIONS statement into greenplum header.

上级 5e793f60
......@@ -121,7 +121,7 @@ check_and_dump_old_cluster(bool live_check, char **sequence_script_file_name)
if (GET_MAJOR_VERSION(old_cluster.major_version) == 802)
{
old_8_3_check_for_name_data_type_usage(&old_cluster);
old_GPDB4_check_for_money_data_type_usage();
old_GPDB4_check_no_free_aoseg();
check_hash_partition_usage();
......@@ -267,7 +267,7 @@ issue_warnings_and_set_wal_level(char *sequence_script_file_name)
{
prep_status("Adjusting sequences");
exec_prog(UTILITY_LOG_FILE, NULL, true, true,
"PGOPTIONS='-c gp_session_role=utility' "
PG_OPTIONS_UTILITY_MODE
"\"%s/psql\" " EXEC_PSQL_ARGS " %s -f \"%s\"",
new_cluster.bindir, cluster_conn_opts(&new_cluster),
sequence_script_file_name);
......
......@@ -13,6 +13,7 @@
#include <sys/types.h>
#include "greenplum/pg_upgrade_greenplum.h"
void
generate_old_dump(void)
......@@ -23,7 +24,7 @@ generate_old_dump(void)
/* run new pg_dumpall binary for globals */
exec_prog(UTILITY_LOG_FILE, NULL, true, true,
"PGOPTIONS='-c gp_session_role=utility' "
PG_OPTIONS_UTILITY_MODE
"\"%s/pg_dumpall\" %s --schema-only --globals-only "
"--quote-all-identifiers --binary-upgrade %s -f %s",
new_cluster.bindir, cluster_conn_opts(&old_cluster),
......@@ -54,7 +55,7 @@ generate_old_dump(void)
snprintf(log_file_name, sizeof(log_file_name), DB_DUMP_LOG_FILE_MASK, old_db->db_oid);
parallel_exec_prog(log_file_name, NULL,
"PGOPTIONS='-c gp_session_role=utility' "
PG_OPTIONS_UTILITY_MODE
"\"%s/pg_dump\" %s --schema-only --quote-all-identifiers "
"--binary-upgrade --format=custom %s --file=\"%s\" %s",
new_cluster.bindir, cluster_conn_opts(&old_cluster),
......
......@@ -10,6 +10,7 @@
#include "pg_upgrade.h"
#define PG_OPTIONS_UTILITY_MODE " PGOPTIONS='-c gp_session_role=utility' "
/* aotable.c */
......
......@@ -465,7 +465,8 @@ prepare_new_cluster(void)
{
prep_status("Analyzing all rows in the new cluster");
exec_prog(UTILITY_LOG_FILE, NULL, true, true,
"PGOPTIONS='-c gp_session_role=utility' \"%s/vacuumdb\" %s --all --analyze %s",
PG_OPTIONS_UTILITY_MODE
"\"%s/vacuumdb\" %s --all --analyze %s",
new_cluster.bindir, cluster_conn_opts(&new_cluster),
log_opts.verbose ? "--verbose" : "");
check_ok();
......@@ -479,7 +480,7 @@ prepare_new_cluster(void)
*/
prep_status("Freezing all rows on the new cluster");
exec_prog(UTILITY_LOG_FILE, NULL, true, true,
"PGOPTIONS='-c gp_session_role=utility' "
PG_OPTIONS_UTILITY_MODE
"\"%s/vacuumdb\" %s --all --freeze %s",
new_cluster.bindir, cluster_conn_opts(&new_cluster),
log_opts.verbose ? "--verbose" : "");
......@@ -517,7 +518,7 @@ prepare_new_databases(void)
* the template0 template.
*/
exec_prog(UTILITY_LOG_FILE, NULL, true, true,
"PGOPTIONS='-c gp_session_role=utility' "
PG_OPTIONS_UTILITY_MODE
"\"%s/psql\" " EXEC_PSQL_ARGS " %s -f \"%s\"",
new_cluster.bindir, cluster_conn_opts(&new_cluster),
GLOBALS_DUMP_FILE);
......@@ -577,7 +578,7 @@ create_new_objects(void)
*/
parallel_exec_prog(log_file_name,
NULL,
"PGOPTIONS='-c gp_session_role=utility' "
PG_OPTIONS_UTILITY_MODE
"\"%s/pg_restore\" %s --exit-on-error --binary-upgrade --verbose --dbname %s \"%s\"",
new_cluster.bindir,
cluster_conn_opts(&new_cluster),
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册