Commit 690c8802 authored by Michael Paquier's avatar Michael Paquier

Improve some comments in pg_upgrade.c

When restoring database schemas on a new cluster, database "template1"
is processed first, followed by all other databases in parallel,
including "postgres".  Both "postgres" and "template1" have some extra
handling to propagate each one's properties, but comments were confusing
regarding which one is processed where.

Author: Julien Rouhaud
Reviewed-by: Daniel Gustafsson
Discussion: https://postgr.es/m/CAOBaU_a2iviTG7FE10yO_gcW+zQCHNFhRA_NDiktf3UR65BHdw@mail.gmail.com
parent 28f4bba6
...@@ -341,10 +341,9 @@ create_new_objects(void) ...@@ -341,10 +341,9 @@ create_new_objects(void)
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);
/* /*
* template1 and postgres databases will already exist in the target * template1 database will already exist in the target installation,
* installation, so tell pg_restore to drop and recreate them; * so tell pg_restore to drop and recreate it; otherwise we would fail
* otherwise we would fail to propagate their database-level * to propagate its database-level properties.
* properties.
*/ */
create_opts = "--clean --create"; create_opts = "--clean --create";
...@@ -378,10 +377,9 @@ create_new_objects(void) ...@@ -378,10 +377,9 @@ create_new_objects(void)
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);
/* /*
* template1 and postgres databases will already exist in the target * postgres database will already exist in the target installation, so
* installation, so tell pg_restore to drop and recreate them; * tell pg_restore to drop and recreate it; otherwise we would fail to
* otherwise we would fail to propagate their database-level * propagate its database-level properties.
* properties.
*/ */
if (strcmp(old_db->db_name, "postgres") == 0) if (strcmp(old_db->db_name, "postgres") == 0)
create_opts = "--clean --create"; create_opts = "--clean --create";
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment