Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit1c07350

Browse files
committed
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 isactually coming out of to_timestamp. We can phrase it as "is onlysupported in to_char", instead. Also, use the term "formatting field" not"format pattern", because other error messages in the same file prefer thatterminology. (This isn't terribly consistent with the documentation, somaybe we should change all these error messages?)
1 parent10257fc commit1c07350

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

‎src/backend/utils/adt/formatting.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3031,7 +3031,9 @@ DCH_from_char(FormatNode *node, char *in, TmFromChar *out)
30313031
caseDCH_OF:
30323032
ereport(ERROR,
30333033
(errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
3034-
errmsg("\"TZ\"/\"tz\"/\"OF\" format patterns are not supported in to_date")));
3034+
errmsg("formatting field \"%s\" is only supported in to_char",
3035+
n->key->name)));
3036+
break;
30353037
caseDCH_A_D:
30363038
caseDCH_B_C:
30373039
caseDCH_a_d:

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp