{
                        ereport(ERROR,
                                        (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
-                                        errmsg("cannot perform FREEZE on a partitioned table")));
+                                        errmsg("cannot perform COPY FREEZE on a partitioned table")));
                }
 
                /*
                if (!ThereAreNoPriorRegisteredSnapshots() || !ThereAreNoReadyPortals())
                        ereport(ERROR,
                                        (errcode(ERRCODE_INVALID_TRANSACTION_STATE),
-                                        errmsg("cannot perform FREEZE because of prior transaction activity")));
+                                        errmsg("cannot perform COPY FREEZE because of prior transaction activity")));
 
                if (cstate->rel->rd_createSubid != GetCurrentSubTransactionId() &&
                        cstate->rel->rd_newRelfilenodeSubid != GetCurrentSubTransactionId())
                        ereport(ERROR,
                                        (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
-                                        errmsg("cannot perform FREEZE because the table was not created or truncated in the current subtransaction")));
+                                        errmsg("cannot perform COPY FREEZE because the table was not created or truncated in the current subtransaction")));
 
                ti_options |= TABLE_INSERT_FROZEN;
        }
 
                else
                        ereport(ERROR,
                                        (errcode(ERRCODE_SYNTAX_ERROR),
-                                        errmsg("unrecognized publication parameter: %s", defel->defname)));
+                                        errmsg("unrecognized publication parameter: \"%s\"", defel->defname)));
        }
 }
 
 
                else
                        ereport(ERROR,
                                        (errcode(ERRCODE_SYNTAX_ERROR),
-                                        errmsg("unrecognized subscription parameter: %s", defel->defname)));
+                                        errmsg("unrecognized subscription parameter: \"%s\"", defel->defname)));
        }
 
        /*
                if (enabled && *enabled_given && *enabled)
                        ereport(ERROR,
                                        (errcode(ERRCODE_SYNTAX_ERROR),
-                                        errmsg("connect = false and enabled = true are mutually exclusive options")));
+                       /*- translator: both %s are strings of the form "option = value" */
+                                        errmsg("%s and %s are mutually exclusive options",
+                                                       "connect = false", "enabled = true")));
 
                if (create_slot && create_slot_given && *create_slot)
                        ereport(ERROR,
                                        (errcode(ERRCODE_SYNTAX_ERROR),
-                                        errmsg("connect = false and create_slot = true are mutually exclusive options")));
+                                        errmsg("%s and %s are mutually exclusive options",
+                                                       "connect = false", "create_slot = true")));
 
                if (copy_data && copy_data_given && *copy_data)
                        ereport(ERROR,
                                        (errcode(ERRCODE_SYNTAX_ERROR),
-                                        errmsg("connect = false and copy_data = true are mutually exclusive options")));
+                                        errmsg("%s and %s are mutually exclusive options",
+                                                       "connect = false", "copy_data = true")));
 
                /* Change the defaults of other options. */
                *enabled = false;
                if (enabled && *enabled_given && *enabled)
                        ereport(ERROR,
                                        (errcode(ERRCODE_SYNTAX_ERROR),
-                                        errmsg("slot_name = NONE and enabled = true are mutually exclusive options")));
+                       /*- translator: both %s are strings of the form "option = value" */
+                                        errmsg("%s and %s are mutually exclusive options",
+                                                       "slot_name = NONE", "enable = true")));
 
                if (create_slot && create_slot_given && *create_slot)
                        ereport(ERROR,
                                        (errcode(ERRCODE_SYNTAX_ERROR),
-                                        errmsg("slot_name = NONE and create_slot = true are mutually exclusive options")));
+                                        errmsg("%s and %s are mutually exclusive options",
+                                                       "slot_name = NONE", "create_slot = true")));
 
                if (enabled && !*enabled_given && *enabled)
                        ereport(ERROR,
                                        (errcode(ERRCODE_SYNTAX_ERROR),
-                                        errmsg("subscription with slot_name = NONE must also set enabled = false")));
+                       /*- translator: both %s are strings of the form "option = value" */
+                                        errmsg("subscription with %s must also set %s",
+                                                       "slot_name = NONE", "enabled = false")));
 
                if (create_slot && !create_slot_given && *create_slot)
                        ereport(ERROR,
                                        (errcode(ERRCODE_SYNTAX_ERROR),
-                                        errmsg("subscription with slot_name = NONE must also set create_slot = false")));
+                                        errmsg("subscription with %s must also set %s",
+                                                       "slot_name = NONE", "create_slot = false")));
        }
 }
 
        }
        else
                ereport(WARNING,
-                               (errmsg("tables were not subscribed, you will have to run "
-                                               "ALTER SUBSCRIPTION ... REFRESH PUBLICATION to "
-                                               "subscribe the tables")));
+               /* translator: %s is an SQL ALTER statement */
+                               (errmsg("tables were not subscribed, you will have to run %s to subscribe the tables",
+                                               "ALTER SUBSCRIPTION ... REFRESH PUBLICATION")));
 
        table_close(rel, RowExclusiveLock);
 
                                        if (sub->enabled && !slotname)
                                                ereport(ERROR,
                                                                (errcode(ERRCODE_SYNTAX_ERROR),
-                                                                errmsg("cannot set slot_name = NONE for enabled subscription")));
+                                                                errmsg("cannot set %s for enabled subscription",
+                                                                               "slot_name = NONE")));
 
                                        if (slotname)
                                                values[Anum_pg_subscription_subslotname - 1] =
                                (errmsg("could not connect to publisher when attempting to "
                                                "drop the replication slot \"%s\"", slotname),
                                 errdetail("The error was: %s", err),
-                                errhint("Use ALTER SUBSCRIPTION ... SET (slot_name = NONE) "
-                                                "to disassociate the subscription from the slot.")));
+               /* translator: %s is an SQL ALTER command */
+                                errhint("Use %s to disassociate the subscription from the slot.",
+                                                "ALTER SUBSCRIPTION ... SET (slot_name = NONE)")));
 
        PG_TRY();
        {
 
                                if (strategy == PARTITION_STRATEGY_HASH)
                                        ereport(ERROR,
                                                        (errcode(ERRCODE_UNDEFINED_OBJECT),
-                                                        errmsg("data type %s has no default hash operator class",
-                                                                       format_type_be(atttype)),
+                                                        errmsg("data type %s has no default operator class for access method \"%s\"",
+                                                                       format_type_be(atttype), "hash"),
                                                         errhint("You must specify a hash operator class or define a default hash operator class for the data type.")));
                                else
                                        ereport(ERROR,
                                                        (errcode(ERRCODE_UNDEFINED_OBJECT),
-                                                        errmsg("data type %s has no default btree operator class",
-                                                                       format_type_be(atttype)),
+                                                        errmsg("data type %s has no default operator class for access method \"%s\"",
+                                                                       format_type_be(atttype), "btree"),
                                                         errhint("You must specify a btree operator class or define a default btree operator class for the data type.")));
 
                        }
 
                if (stmt->into->rel->relpersistence == RELPERSISTENCE_UNLOGGED)
                        ereport(ERROR,
                                        (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
-                                        errmsg("materialized views cannot be UNLOGGED")));
+                                        errmsg("materialized views cannot be unlogged")));
 
                /*
                 * At runtime, we'll need a copy of the parsed-but-not-rewritten Query
 
                                continue;
                        ereport(COMMERROR,
                                        (errcode_for_socket_access(),
-                                        errmsg("failed to send GSSAPI negotiation response: %m)")));
+                                        errmsg("failed to send GSSAPI negotiation response: %m")));
                        return STATUS_ERROR;    /* close the connection */
                }
 
                /* Reload authentication config files too */
                if (!load_hba())
                        ereport(LOG,
-                                       (errmsg("pg_hba.conf was not reloaded")));
+                       /* translator: %s is a configuration file */
+                                       (errmsg("%s was not reloaded", "pg_hba.conf")));
 
                if (!load_ident())
                        ereport(LOG,
-                                       (errmsg("pg_ident.conf was not reloaded")));
+                                       (errmsg("%s was not reloaded", "pg_ident.conf")));
 
 #ifdef USE_SSL
                /* Reload SSL configuration as well */
 
                {
                        if (IsTransactionBlock())
                                ereport(ERROR,
-                                               (errmsg("CREATE_REPLICATION_SLOT ... EXPORT_SNAPSHOT "
-                                                               "must not be called inside a transaction")));
+                               /*- translator: %s is a CREATE_REPLICATION_SLOT statement */
+                                               (errmsg("%s must not be called inside a transaction",
+                                                               "CREATE_REPLICATION_SLOT ... EXPORT_SNAPSHOT")));
 
                        need_full_snapshot = true;
                }
                {
                        if (!IsTransactionBlock())
                                ereport(ERROR,
-                                               (errmsg("CREATE_REPLICATION_SLOT ... USE_SNAPSHOT "
-                                                               "must be called inside a transaction")));
+                               /*- translator: %s is a CREATE_REPLICATION_SLOT statement */
+                                               (errmsg("%s must be called inside a transaction",
+                                                               "CREATE_REPLICATION_SLOT ... USE_SNAPSHOT")));
 
                        if (XactIsoLevel != XACT_REPEATABLE_READ)
                                ereport(ERROR,
-                                               (errmsg("CREATE_REPLICATION_SLOT ... USE_SNAPSHOT "
-                                                               "must be called in REPEATABLE READ isolation mode transaction")));
+                               /*- translator: %s is a CREATE_REPLICATION_SLOT statement */
+                                               (errmsg("%s must be called in REPEATABLE READ isolation mode transaction",
+                                                               "CREATE_REPLICATION_SLOT ... USE_SNAPSHOT")));
 
                        if (FirstSnapshotSet)
                                ereport(ERROR,
-                                               (errmsg("CREATE_REPLICATION_SLOT ... USE_SNAPSHOT "
-                                                               "must be called before any query")));
+                               /*- translator: %s is a CREATE_REPLICATION_SLOT statement */
+                                               (errmsg("%s must be called before any query",
+                                                               "CREATE_REPLICATION_SLOT ... USE_SNAPSHOT")));
 
                        if (IsSubTransaction())
                                ereport(ERROR,
-                                               (errmsg("CREATE_REPLICATION_SLOT ... USE_SNAPSHOT "
-                                                               "must not be called in a subtransaction")));
+                               /*- translator: %s is a CREATE_REPLICATION_SLOT statement */
+                                               (errmsg("%s must not be called in a subtransaction",
+                                                               "CREATE_REPLICATION_SLOT ... USE_SNAPSHOT")));
 
                        need_full_snapshot = true;
                }
 
        if (!jsonpath)
                ereport(ERROR,
                                (errcode(ERRCODE_INVALID_TEXT_REPRESENTATION),
-                                errmsg("invalid input syntax for jsonpath: \"%s\"", in)));
+                                errmsg("invalid input syntax for type %s: \"%s\"", "jsonpath",
+                                               in)));
 
        flattenJsonPathParseItem(&buf, jsonpath->expr, 0, false);
 
 
        {
                ereport(ERROR,
                                (errcode(ERRCODE_UNDEFINED_OBJECT),
-                                errmsg("cannot find jsonpath variable \"%s\"",
+                                errmsg("could not find jsonpath variable \"%s\"",
                                                pnstrdup(varName, varNameLength))));
        }
 
 
        {
                ereport(ERROR,
                                (errcode(ERRCODE_INVALID_TEXT_REPRESENTATION),
-                                errmsg("invalid input syntax for type jsonpath"),
+                                errmsg("invalid input syntax for type %s", "jsonpath"),
                                 errdetail("Unicode escape values cannot be used for code "
                                                   "point values above 007F when the server encoding "
                                                   "is not UTF8.")));
                if (*hi_surrogate != -1)
                        ereport(ERROR,
                                        (errcode(ERRCODE_INVALID_TEXT_REPRESENTATION),
-                                        errmsg("invalid input syntax for type jsonpath"),
+                                        errmsg("invalid input syntax for type %s", "jsonpath"),
                                         errdetail("Unicode high surrogate must not follow "
                                                           "a high surrogate.")));
                *hi_surrogate = (ch & 0x3ff) << 10;
                if (*hi_surrogate == -1)
                        ereport(ERROR,
                                        (errcode(ERRCODE_INVALID_TEXT_REPRESENTATION),
-                                        errmsg("invalid input syntax for type jsonpath"),
+                                        errmsg("invalid input syntax for type %s", "jsonpath"),
                                         errdetail("Unicode low surrogate must follow a high "
                                                           "surrogate.")));
                ch = 0x10000 + *hi_surrogate + (ch & 0x3ff);
        {
                ereport(ERROR,
                                (errcode(ERRCODE_INVALID_TEXT_REPRESENTATION),
-                                errmsg("invalid input syntax for type jsonpath"),
+                                errmsg("invalid input syntax for type %s", "jsonpath"),
                                 errdetail("Unicode low surrogate must follow a high "
                                                   "surrogate.")));
        }
        {
                ereport(ERROR,
                                (errcode(ERRCODE_INVALID_TEXT_REPRESENTATION),
-                                errmsg("invalid input syntax for type jsonpath"),
+                                errmsg("invalid input syntax for type %s", "jsonpath"),
                                 errdetail("Unicode low surrogate must follow a high "
                                                   "surrogate.")));
        }
 
                                                          buff, nbytes, &status);
        if (U_FAILURE(status) && status != U_BUFFER_OVERFLOW_ERROR)
                ereport(ERROR,
-                               (errmsg("ucnv_toUChars failed: %s", u_errorName(status))));
+                               (errmsg("%s failed: %s", "ucnv_toUChars", u_errorName(status))));
 
        *buff_uchar = palloc((len_uchar + 1) * sizeof(**buff_uchar));
 
                                                          buff, nbytes, &status);
        if (U_FAILURE(status))
                ereport(ERROR,
-                               (errmsg("ucnv_toUChars failed: %s", u_errorName(status))));
+                               (errmsg("%s failed: %s", "ucnv_toUChars", u_errorName(status))));
 
        return len_uchar;
 }
                                                                 buff_uchar, len_uchar, &status);
        if (U_FAILURE(status) && status != U_BUFFER_OVERFLOW_ERROR)
                ereport(ERROR,
-                               (errmsg("ucnv_fromUChars failed: %s", u_errorName(status))));
+                               (errmsg("%s failed: %s", "ucnv_fromUChars",
+                                               u_errorName(status))));
 
        *result = palloc(len_result + 1);
 
                                                                 buff_uchar, len_uchar, &status);
        if (U_FAILURE(status))
                ereport(ERROR,
-                               (errmsg("ucnv_fromUChars failed: %s", u_errorName(status))));
+                               (errmsg("%s failed: %s", "ucnv_fromUChars",
+                                               u_errorName(status))));
 
        return len_result;
 }
 
                                default:
                                        ereport(ERROR,
                                                        (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-                                                        errmsg("invalid regexp option: \"%c\"",
+                                                        errmsg("invalid regular expression option: \"%c\"",
                                                                        opt_p[i])));
                                        break;
                        }
        if (re_flags.glob)
                ereport(ERROR,
                                (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-                                errmsg("regexp_match does not support the global option"),
+               /* translator: %s is a SQL function name */
+                                errmsg("%s does not support the \"global\" option",
+                                               "regexp_match()"),
                                 errhint("Use the regexp_matches function instead.")));
 
        matchctx = setup_regexp_matches(orig_str, pattern, &re_flags,
                if (re_flags.glob)
                        ereport(ERROR,
                                        (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-                                        errmsg("regexp_split_to_table does not support the global option")));
+                       /* translator: %s is a SQL function name */
+                                        errmsg("%s does not support the \"global\" option",
+                                                       "regexp_split_to_table()")));
                /* But we find all the matches anyway */
                re_flags.glob = true;
 
        if (re_flags.glob)
                ereport(ERROR,
                                (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-                                errmsg("regexp_split_to_array does not support the global option")));
+               /* translator: %s is a SQL function name */
+                                errmsg("%s does not support the \"global\" option",
+                                               "regexp_split_to_array()")));
        /* But we find all the matches anyway */
        re_flags.glob = true;