Skip to content

Commit ec6e70c

Browse files
committed
Refactor some error messages for easier translation
1 parent a363bc6 commit ec6e70c

File tree

4 files changed

+9
-9
lines changed

4 files changed

+9
-9
lines changed

src/backend/access/common/toast_compression.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ int default_toast_compression = TOAST_PGLZ_COMPRESSION;
3131
(errcode(ERRCODE_FEATURE_NOT_SUPPORTED), \
3232
errmsg("unsupported LZ4 compression method"), \
3333
errdetail("This functionality requires the server to be built with lz4 support."), \
34-
errhint("You need to rebuild PostgreSQL using --with-lz4.")))
34+
errhint("You need to rebuild PostgreSQL using %s.", "--with-lz4")))
3535

3636
/*
3737
* Compress a varlena using PGLZ.

src/backend/parser/parse_coerce.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2086,7 +2086,7 @@ enforce_generic_type_consistency(const Oid *actual_arg_types,
20862086
if (OidIsValid(elem_typeid) && actual_type != elem_typeid)
20872087
ereport(ERROR,
20882088
(errcode(ERRCODE_DATATYPE_MISMATCH),
2089-
errmsg("arguments declared \"anyelement\" are not all alike"),
2089+
errmsg("arguments declared \"%s\" are not all alike", "anyelement"),
20902090
errdetail("%s versus %s",
20912091
format_type_be(elem_typeid),
20922092
format_type_be(actual_type))));
@@ -2106,7 +2106,7 @@ enforce_generic_type_consistency(const Oid *actual_arg_types,
21062106
if (OidIsValid(array_typeid) && actual_type != array_typeid)
21072107
ereport(ERROR,
21082108
(errcode(ERRCODE_DATATYPE_MISMATCH),
2109-
errmsg("arguments declared \"anyarray\" are not all alike"),
2109+
errmsg("arguments declared \"%s\" are not all alike", "anyarray"),
21102110
errdetail("%s versus %s",
21112111
format_type_be(array_typeid),
21122112
format_type_be(actual_type))));
@@ -2126,7 +2126,7 @@ enforce_generic_type_consistency(const Oid *actual_arg_types,
21262126
if (OidIsValid(range_typeid) && actual_type != range_typeid)
21272127
ereport(ERROR,
21282128
(errcode(ERRCODE_DATATYPE_MISMATCH),
2129-
errmsg("arguments declared \"anyrange\" are not all alike"),
2129+
errmsg("arguments declared \"%s\" are not all alike", "anyrange"),
21302130
errdetail("%s versus %s",
21312131
format_type_be(range_typeid),
21322132
format_type_be(actual_type))));
@@ -2146,7 +2146,7 @@ enforce_generic_type_consistency(const Oid *actual_arg_types,
21462146
if (OidIsValid(multirange_typeid) && actual_type != multirange_typeid)
21472147
ereport(ERROR,
21482148
(errcode(ERRCODE_DATATYPE_MISMATCH),
2149-
errmsg("arguments declared \"anymultirange\" are not all alike"),
2149+
errmsg("arguments declared \"%s\" are not all alike", "anymultirange"),
21502150
errdetail("%s versus %s",
21512151
format_type_be(multirange_typeid),
21522152
format_type_be(actual_type))));
@@ -2201,7 +2201,7 @@ enforce_generic_type_consistency(const Oid *actual_arg_types,
22012201
if (anycompatible_range_typeid != actual_type)
22022202
ereport(ERROR,
22032203
(errcode(ERRCODE_DATATYPE_MISMATCH),
2204-
errmsg("arguments declared \"anycompatiblerange\" are not all alike"),
2204+
errmsg("arguments declared \"%s\" are not all alike", "anycompatiblerange"),
22052205
errdetail("%s versus %s",
22062206
format_type_be(anycompatible_range_typeid),
22072207
format_type_be(actual_type))));
@@ -2234,7 +2234,7 @@ enforce_generic_type_consistency(const Oid *actual_arg_types,
22342234
if (anycompatible_multirange_typeid != actual_type)
22352235
ereport(ERROR,
22362236
(errcode(ERRCODE_DATATYPE_MISMATCH),
2237-
errmsg("arguments declared \"anycompatiblemultirange\" are not all alike"),
2237+
errmsg("arguments declared \"%s\" are not all alike", "anycompatiblemultirange"),
22382238
errdetail("%s versus %s",
22392239
format_type_be(anycompatible_multirange_typeid),
22402240
format_type_be(actual_type))));

src/backend/utils/adt/pg_locale.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1586,7 +1586,7 @@ pg_newlocale_from_collation(Oid collid)
15861586
ereport(ERROR,
15871587
(errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
15881588
errmsg("ICU is not supported in this build"), \
1589-
errhint("You need to rebuild PostgreSQL using --with-icu.")));
1589+
errhint("You need to rebuild PostgreSQL using %s.", "--with-icu")));
15901590
#endif /* not USE_ICU */
15911591
}
15921592

src/backend/utils/adt/xml.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ const TableFuncRoutine XmlTableRoutine =
221221
(errcode(ERRCODE_FEATURE_NOT_SUPPORTED), \
222222
errmsg("unsupported XML feature"), \
223223
errdetail("This functionality requires the server to be built with libxml support."), \
224-
errhint("You need to rebuild PostgreSQL using --with-libxml.")))
224+
errhint("You need to rebuild PostgreSQL using %s.", "--with-libxml")))
225225

226226

227227
/* from SQL/XML:2008 section 4.9 */

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy