Commit 1c073505 authored by Tom Lane's avatar Tom Lane

Improve error message for misuse of TZ, tz, OF formatting patterns.

Be specific about which pattern is being complained of, and avoid saying
"it's not supported in to_date", which is just confusing if the error is
actually coming out of to_timestamp.  We can phrase it as "is only
supported in to_char", instead.  Also, use the term "formatting field" not
"format pattern", because other error messages in the same file prefer that
terminology.  (This isn't terribly consistent with the documentation, so
maybe we should change all these error messages?)
parent 10257fc5
...@@ -3031,7 +3031,9 @@ DCH_from_char(FormatNode *node, char *in, TmFromChar *out) ...@@ -3031,7 +3031,9 @@ DCH_from_char(FormatNode *node, char *in, TmFromChar *out)
case DCH_OF: case DCH_OF:
ereport(ERROR, ereport(ERROR,
(errcode(ERRCODE_FEATURE_NOT_SUPPORTED), (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
errmsg("\"TZ\"/\"tz\"/\"OF\" format patterns are not supported in to_date"))); errmsg("formatting field \"%s\" is only supported in to_char",
n->key->name)));
break;
case DCH_A_D: case DCH_A_D:
case DCH_B_C: case DCH_B_C:
case DCH_a_d: case DCH_a_d:
......
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