1
0
mirror of https://github.com/postgres/postgres.git synced 2025-11-29 23:43:17 +03:00

Replace errdetail("%s", ...) with errdetail_internal("%s", ...).

There may be some other places where we should use errdetail_internal,
but they'll have to be evaluated case-by-case.  This commit just hits
a bunch of places where invoking gettext is obviously a waste of cycles.
This commit is contained in:
Tom Lane
2011-07-16 14:21:24 -04:00
parent 3b41d490bb
commit fbd847a587
12 changed files with 33 additions and 32 deletions

View File

@@ -1363,14 +1363,14 @@ xml_ereport(int level, int sqlcode, const char *msg)
ereport(level,
(errcode(sqlcode),
errmsg("%s", msg),
errdetail("%s", detail)));
errmsg_internal("%s", msg),
errdetail_internal("%s", detail)));
}
else
{
ereport(level,
(errcode(sqlcode),
errmsg("%s", msg)));
errmsg_internal("%s", msg)));
}
}
@@ -1441,7 +1441,7 @@ xml_ereport_by_code(int level, int sqlcode,
ereport(level,
(errcode(sqlcode),
errmsg("%s", msg),
errmsg_internal("%s", msg),
errdetail(det, code)));
}

View File

@@ -378,7 +378,7 @@ incompatible_module_error(const char *libname,
ereport(ERROR,
(errmsg("incompatible library \"%s\": magic block mismatch",
libname),
errdetail("%s", details.data)));
errdetail_internal("%s", details.data)));
}
/*

View File

@@ -7985,11 +7985,11 @@ call_bool_check_hook(struct config_bool * conf, bool *newval, void **extra,
ereport(elevel,
(errcode(GUC_check_errcode_value),
GUC_check_errmsg_string ?
errmsg("%s", GUC_check_errmsg_string) :
errmsg_internal("%s", GUC_check_errmsg_string) :
errmsg("invalid value for parameter \"%s\": %d",
conf->gen.name, (int) *newval),
GUC_check_errdetail_string ?
errdetail("%s", GUC_check_errdetail_string) : 0,
errdetail_internal("%s", GUC_check_errdetail_string) : 0,
GUC_check_errhint_string ?
errhint("%s", GUC_check_errhint_string) : 0));
/* Flush any strings created in ErrorContext */
@@ -8019,11 +8019,11 @@ call_int_check_hook(struct config_int * conf, int *newval, void **extra,
ereport(elevel,
(errcode(GUC_check_errcode_value),
GUC_check_errmsg_string ?
errmsg("%s", GUC_check_errmsg_string) :
errmsg_internal("%s", GUC_check_errmsg_string) :
errmsg("invalid value for parameter \"%s\": %d",
conf->gen.name, *newval),
GUC_check_errdetail_string ?
errdetail("%s", GUC_check_errdetail_string) : 0,
errdetail_internal("%s", GUC_check_errdetail_string) : 0,
GUC_check_errhint_string ?
errhint("%s", GUC_check_errhint_string) : 0));
/* Flush any strings created in ErrorContext */
@@ -8053,11 +8053,11 @@ call_real_check_hook(struct config_real * conf, double *newval, void **extra,
ereport(elevel,
(errcode(GUC_check_errcode_value),
GUC_check_errmsg_string ?
errmsg("%s", GUC_check_errmsg_string) :
errmsg_internal("%s", GUC_check_errmsg_string) :
errmsg("invalid value for parameter \"%s\": %g",
conf->gen.name, *newval),
GUC_check_errdetail_string ?
errdetail("%s", GUC_check_errdetail_string) : 0,
errdetail_internal("%s", GUC_check_errdetail_string) : 0,
GUC_check_errhint_string ?
errhint("%s", GUC_check_errhint_string) : 0));
/* Flush any strings created in ErrorContext */
@@ -8087,11 +8087,11 @@ call_string_check_hook(struct config_string * conf, char **newval, void **extra,
ereport(elevel,
(errcode(GUC_check_errcode_value),
GUC_check_errmsg_string ?
errmsg("%s", GUC_check_errmsg_string) :
errmsg_internal("%s", GUC_check_errmsg_string) :
errmsg("invalid value for parameter \"%s\": \"%s\"",
conf->gen.name, *newval ? *newval : ""),
GUC_check_errdetail_string ?
errdetail("%s", GUC_check_errdetail_string) : 0,
errdetail_internal("%s", GUC_check_errdetail_string) : 0,
GUC_check_errhint_string ?
errhint("%s", GUC_check_errhint_string) : 0));
/* Flush any strings created in ErrorContext */
@@ -8121,12 +8121,12 @@ call_enum_check_hook(struct config_enum * conf, int *newval, void **extra,
ereport(elevel,
(errcode(GUC_check_errcode_value),
GUC_check_errmsg_string ?
errmsg("%s", GUC_check_errmsg_string) :
errmsg_internal("%s", GUC_check_errmsg_string) :
errmsg("invalid value for parameter \"%s\": \"%s\"",
conf->gen.name,
config_enum_lookup_by_value(conf, *newval)),
GUC_check_errdetail_string ?
errdetail("%s", GUC_check_errdetail_string) : 0,
errdetail_internal("%s", GUC_check_errdetail_string) : 0,
GUC_check_errhint_string ?
errhint("%s", GUC_check_errhint_string) : 0));
/* Flush any strings created in ErrorContext */