From f10820bb9e2912fcc27791e71d900e1cf3edfaba Mon Sep 17 00:00:00 2001 From: Heikki Linnakangas Date: Mon, 6 Jul 2009 19:11:39 +0000 Subject: [PATCH] Fix ancient bug in handling of to_char modifier 'TH', when used with HH. In what seems like an oversight, we used to treat 'TH' the same as lowercase 'th', but only with HH/HH12. --- src/backend/utils/adt/formatting.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/backend/utils/adt/formatting.c b/src/backend/utils/adt/formatting.c index e4f70557c4..73e3c84518 100644 --- a/src/backend/utils/adt/formatting.c +++ b/src/backend/utils/adt/formatting.c @@ -2094,7 +2094,7 @@ DCH_to_char(FormatNode *node, bool is_interval, TmToChar *in, char *out) tm->tm_hour % (HOURS_PER_DAY / 2) == 0 ? 12 : tm->tm_hour % (HOURS_PER_DAY / 2)); if (S_THth(n->suffix)) - str_numth(s, s, 0); + str_numth(s, s, S_TH_TYPE(n->suffix)); s += strlen(s); break; case DCH_HH24: -- 2.39.5