]> granicus.if.org Git - postgresql/commitdiff
pg_upgrade: Message translatability and style fixes
authorPeter Eisentraut <peter_e@gmx.net>
Wed, 23 Aug 2017 00:32:17 +0000 (20:32 -0400)
committerPeter Eisentraut <peter_e@gmx.net>
Wed, 23 Aug 2017 00:33:57 +0000 (20:33 -0400)
src/bin/pg_upgrade/check.c
src/bin/pg_upgrade/exec.c
src/bin/pg_upgrade/function.c
src/bin/pg_upgrade/pg_upgrade.c
src/bin/pg_upgrade/server.c
src/bin/pg_upgrade/version.c

index 11f804b7e87f621b18a9ea767346d215cfab604a..327c78e87904c568be97e2c5d93a036514a9f8ab 100644 (file)
@@ -62,13 +62,15 @@ output_check_banner(bool live_check)
 {
        if (user_opts.check && live_check)
        {
-               pg_log(PG_REPORT, "Performing Consistency Checks on Old Live Server\n");
-               pg_log(PG_REPORT, "------------------------------------------------\n");
+               pg_log(PG_REPORT,
+                          "Performing Consistency Checks on Old Live Server\n"
+                          "------------------------------------------------\n");
        }
        else
        {
-               pg_log(PG_REPORT, "Performing Consistency Checks\n");
-               pg_log(PG_REPORT, "-----------------------------\n");
+               pg_log(PG_REPORT,
+                          "Performing Consistency Checks\n"
+                          "-----------------------------\n");
        }
 }
 
@@ -991,7 +993,7 @@ check_for_jsonb_9_4_usage(ClusterInfo *cluster)
        bool            found = false;
        char            output_path[MAXPGPATH];
 
-       prep_status("Checking for JSONB user data types");
+       prep_status("Checking for incompatible jsonb data type");
 
        snprintf(output_path, sizeof(output_path), "tables_using_jsonb.txt");
 
@@ -1022,7 +1024,7 @@ check_for_jsonb_9_4_usage(ClusterInfo *cluster)
                                                                "               a.atttypid = 'pg_catalog.jsonb'::pg_catalog.regtype AND "
                                                                "               c.relnamespace = n.oid AND "
                /* exclude possible orphaned temp tables */
-                                                               "               n.nspname !~ '^pg_temp_' AND "
+                                                               "               n.nspname !~ '^pg_temp_' AND "
                                                                "               n.nspname NOT IN ('pg_catalog', 'information_schema')");
 
                ntups = PQntuples(res);
@@ -1057,8 +1059,8 @@ check_for_jsonb_9_4_usage(ClusterInfo *cluster)
        if (found)
        {
                pg_log(PG_REPORT, "fatal\n");
-               pg_fatal("Your installation contains one of the JSONB data types in user tables.\n"
-                                "The internal format of JSONB changed during 9.4 beta so this cluster cannot currently\n"
+               pg_fatal("Your installation contains the \"jsonb\" data type in user tables.\n"
+                                "The internal format of \"jsonb\" changed during 9.4 beta so this cluster cannot currently\n"
                                 "be upgraded.  You can remove the problem tables and restart the upgrade.  A list\n"
                                 "of the problem columns is in the file:\n"
                                 "    %s\n\n", output_path);
@@ -1078,7 +1080,7 @@ check_for_pg_role_prefix(ClusterInfo *cluster)
        PGresult   *res;
        PGconn     *conn = connectToServer(cluster, "template1");
 
-       prep_status("Checking for roles starting with 'pg_'");
+       prep_status("Checking for roles starting with \"pg_\"");
 
        res = executeQueryOrDie(conn,
                                                        "SELECT * "
@@ -1088,9 +1090,9 @@ check_for_pg_role_prefix(ClusterInfo *cluster)
        if (PQntuples(res) != 0)
        {
                if (cluster == &old_cluster)
-                       pg_fatal("The source cluster contains roles starting with 'pg_'\n");
+                       pg_fatal("The source cluster contains roles starting with \"pg_\"\n");
                else
-                       pg_fatal("The target cluster contains roles starting with 'pg_'\n");
+                       pg_fatal("The target cluster contains roles starting with \"pg_\"\n");
        }
 
        PQclear(res);
index cc4b4078db78d8cae9d5ae566e7d5ee52c061cf3..cb8e29b17c8253afe0060cb8bb9759608b819a54 100644 (file)
@@ -307,7 +307,7 @@ check_single_dir(const char *pg_data, const char *subdir)
                report_status(PG_FATAL, "check for \"%s\" failed: %s\n",
                                          subDirName, strerror(errno));
        else if (!S_ISDIR(statBuf.st_mode))
-               report_status(PG_FATAL, "%s is not a directory\n",
+               report_status(PG_FATAL, "\"%s\" is not a directory\n",
                                          subDirName);
 }
 
@@ -370,7 +370,7 @@ check_bin_dir(ClusterInfo *cluster)
                report_status(PG_FATAL, "check for \"%s\" failed: %s\n",
                                          cluster->bindir, strerror(errno));
        else if (!S_ISDIR(statBuf.st_mode))
-               report_status(PG_FATAL, "%s is not a directory\n",
+               report_status(PG_FATAL, "\"%s\" is not a directory\n",
                                          cluster->bindir);
 
        validate_exec(cluster->bindir, "postgres");
index 8383b75325b3ddeffbee885be4b7138ba4a0236f..063a94f0ca04313db8f56be3e31e5d15e2db7ff4 100644 (file)
@@ -252,7 +252,7 @@ check_loadable_libraries(void)
                        if (script == NULL && (script = fopen_priv(output_path, "w")) == NULL)
                                pg_fatal("could not open file \"%s\": %s\n",
                                                 output_path, strerror(errno));
-                       fprintf(script, _("could not load library \"%s\":\n%s\n"),
+                       fprintf(script, _("could not load library \"%s\": %s"),
                                        lib,
                                        PQerrorMessage(conn));
                }
index ef9793f3bdb404ab50787465401b06ff07b45986..2a68ce6efaaabbe32ff4cc159b8beee1a2c4973a 100644 (file)
@@ -104,8 +104,10 @@ main(int argc, char **argv)
        check_new_cluster();
        report_clusters_compatible();
 
-       pg_log(PG_REPORT, "\nPerforming Upgrade\n");
-       pg_log(PG_REPORT, "------------------\n");
+       pg_log(PG_REPORT,
+                  "\n"
+                  "Performing Upgrade\n"
+                  "------------------\n");
 
        prepare_new_cluster();
 
@@ -164,8 +166,10 @@ main(int argc, char **argv)
 
        issue_warnings_and_set_wal_level();
 
-       pg_log(PG_REPORT, "\nUpgrade Complete\n");
-       pg_log(PG_REPORT, "----------------\n");
+       pg_log(PG_REPORT,
+                  "\n"
+                  "Upgrade Complete\n"
+                  "----------------\n");
 
        output_completion_banner(analyze_script_file_name,
                                                         deletion_script_file_name);
index 58e35938967523ec23bbdf85e14ea8092a30cf11..26e60fab469dda5f77978544491cd0d68fcde579 100644 (file)
@@ -30,7 +30,7 @@ connectToServer(ClusterInfo *cluster, const char *db_name)
 
        if (conn == NULL || PQstatus(conn) != CONNECTION_OK)
        {
-               pg_log(PG_REPORT, "connection to database failed: %s\n",
+               pg_log(PG_REPORT, "connection to database failed: %s",
                           PQerrorMessage(conn));
 
                if (conn)
@@ -132,7 +132,7 @@ executeQueryOrDie(PGconn *conn, const char *fmt,...)
 
        if ((status != PGRES_TUPLES_OK) && (status != PGRES_COMMAND_OK))
        {
-               pg_log(PG_REPORT, "SQL command failed\n%s\n%s\n", query,
+               pg_log(PG_REPORT, "SQL command failed\n%s\n%s", query,
                           PQerrorMessage(conn));
                PQclear(result);
                PQfinish(conn);
@@ -281,7 +281,7 @@ start_postmaster(ClusterInfo *cluster, bool throw_error)
        if ((conn = get_db_conn(cluster, "template1")) == NULL ||
                PQstatus(conn) != CONNECTION_OK)
        {
-               pg_log(PG_REPORT, "\nconnection to database failed: %s\n",
+               pg_log(PG_REPORT, "\nconnection to database failed: %s",
                           PQerrorMessage(conn));
                if (conn)
                        PQfinish(conn);
index a9071a3448fd6c537d2a74ed1802b5f3d7cbafbb..524b6042964878a3ab67394f71485c02c20ed580 100644 (file)
@@ -82,7 +82,7 @@ new_9_0_populate_pg_largeobject_metadata(ClusterInfo *cluster, bool check_mode)
                        pg_log(PG_WARNING, "\n"
                                   "Your installation contains large objects.  The new database has an\n"
                                   "additional large object permission table.  After upgrading, you will be\n"
-                                  "given a command to populate the pg_largeobject permission table with\n"
+                                  "given a command to populate the pg_largeobject_metadata table with\n"
                                   "default permissions.\n\n");
                else
                        pg_log(PG_WARNING, "\n"
@@ -115,7 +115,7 @@ old_9_3_check_for_line_data_type_usage(ClusterInfo *cluster)
        bool            found = false;
        char            output_path[MAXPGPATH];
 
-       prep_status("Checking for invalid \"line\" user columns");
+       prep_status("Checking for incompatible \"line\" data type");
 
        snprintf(output_path, sizeof(output_path), "tables_using_line.txt");
 
@@ -390,7 +390,7 @@ old_9_6_invalidate_hash_indexes(ClusterInfo *cluster, bool check_mode)
                        pg_log(PG_WARNING, "\n"
                                   "Your installation contains hash indexes.  These indexes have different\n"
                                   "internal formats between your old and new clusters, so they must be\n"
-                                  "reindexed with the REINDEX command.  The file:\n"
+                                  "reindexed with the REINDEX command.  The file\n"
                                   "    %s\n"
                                   "when executed by psql by the database superuser will recreate all invalid\n"
                                   "indexes; until then, none of these indexes will be used.\n\n",