mirror of
https://github.com/postgres/postgres.git
synced 2025-04-22 23:02:54 +03:00
Use pg_dump's --quote-all-identifiers option in pg_upgrade.
This helps guard against changes in the set of reserved keywords from one version to another. In theory it should only be an issue if we de-reserve a keyword in a newer release, since that can create the type of problem shown in bug #8128. Back-patch to 9.1 where the --quote-all-identifiers option was added.
This commit is contained in:
parent
df9d764186
commit
1c36700e9e
@ -22,7 +22,8 @@ generate_old_dump(void)
|
|||||||
|
|
||||||
/* run new pg_dumpall binary for globals */
|
/* run new pg_dumpall binary for globals */
|
||||||
exec_prog(UTILITY_LOG_FILE, NULL, true,
|
exec_prog(UTILITY_LOG_FILE, NULL, true,
|
||||||
"\"%s/pg_dumpall\" %s --schema-only --globals-only --binary-upgrade %s -f %s",
|
"\"%s/pg_dumpall\" %s --schema-only --globals-only "
|
||||||
|
"--quote-all-identifiers --binary-upgrade %s -f %s",
|
||||||
new_cluster.bindir, cluster_conn_opts(&old_cluster),
|
new_cluster.bindir, cluster_conn_opts(&old_cluster),
|
||||||
log_opts.verbose ? "--verbose" : "",
|
log_opts.verbose ? "--verbose" : "",
|
||||||
GLOBALS_DUMP_FILE);
|
GLOBALS_DUMP_FILE);
|
||||||
@ -30,26 +31,29 @@ generate_old_dump(void)
|
|||||||
|
|
||||||
prep_status("Creating dump of database schemas\n");
|
prep_status("Creating dump of database schemas\n");
|
||||||
|
|
||||||
/* create per-db dump files */
|
/* create per-db dump files */
|
||||||
for (dbnum = 0; dbnum < old_cluster.dbarr.ndbs; dbnum++)
|
for (dbnum = 0; dbnum < old_cluster.dbarr.ndbs; dbnum++)
|
||||||
{
|
{
|
||||||
char sql_file_name[MAXPGPATH], log_file_name[MAXPGPATH];
|
char sql_file_name[MAXPGPATH],
|
||||||
DbInfo *old_db = &old_cluster.dbarr.dbs[dbnum];
|
log_file_name[MAXPGPATH];
|
||||||
|
DbInfo *old_db = &old_cluster.dbarr.dbs[dbnum];
|
||||||
|
|
||||||
pg_log(PG_STATUS, "%s", old_db->db_name);
|
pg_log(PG_STATUS, "%s", old_db->db_name);
|
||||||
snprintf(sql_file_name, sizeof(sql_file_name), DB_DUMP_FILE_MASK, old_db->db_oid);
|
snprintf(sql_file_name, sizeof(sql_file_name), DB_DUMP_FILE_MASK, old_db->db_oid);
|
||||||
snprintf(log_file_name, sizeof(log_file_name), DB_DUMP_LOG_FILE_MASK, old_db->db_oid);
|
snprintf(log_file_name, sizeof(log_file_name), DB_DUMP_LOG_FILE_MASK, old_db->db_oid);
|
||||||
|
|
||||||
parallel_exec_prog(log_file_name, NULL,
|
parallel_exec_prog(log_file_name, NULL,
|
||||||
"\"%s/pg_dump\" %s --schema-only --binary-upgrade --format=custom %s --file=\"%s\" \"%s\"",
|
"\"%s/pg_dump\" %s --schema-only --quote-all-identifiers "
|
||||||
new_cluster.bindir, cluster_conn_opts(&old_cluster),
|
"--binary-upgrade --format=custom %s --file=\"%s\" \"%s\"",
|
||||||
log_opts.verbose ? "--verbose" : "", sql_file_name, old_db->db_name);
|
new_cluster.bindir, cluster_conn_opts(&old_cluster),
|
||||||
|
log_opts.verbose ? "--verbose" : "",
|
||||||
|
sql_file_name, old_db->db_name);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* reap all children */
|
/* reap all children */
|
||||||
while (reap_child(true) == true)
|
while (reap_child(true) == true)
|
||||||
;
|
;
|
||||||
|
|
||||||
end_progress_output();
|
end_progress_output();
|
||||||
check_ok();
|
check_ok();
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user