Skip to content

Commit 44886bd

Browse files
committed
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.
1 parent 9b27eab commit 44886bd

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/backend/utils/adt/formatting.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/* -----------------------------------------------------------------------
22
* formatting.c
33
*
4-
* $PostgreSQL: pgsql/src/backend/utils/adt/formatting.c,v 1.158 2009/06/22 17:54:30 tgl Exp $
4+
* $PostgreSQL: pgsql/src/backend/utils/adt/formatting.c,v 1.159 2009/07/06 19:11:39 heikki Exp $
55
*
66
*
77
* Portions Copyright (c) 1999-2009, PostgreSQL Global Development Group
@@ -2094,7 +2094,7 @@ DCH_to_char(FormatNode *node, bool is_interval, TmToChar *in, char *out)
20942094
tm->tm_hour % (HOURS_PER_DAY / 2) == 0 ? 12 :
20952095
tm->tm_hour % (HOURS_PER_DAY / 2));
20962096
if (S_THth(n->suffix))
2097-
str_numth(s, s, 0);
2097+
str_numth(s, s, S_TH_TYPE(n->suffix));
20982098
s += strlen(s);
20992099
break;
21002100
case DCH_HH24:

0 commit comments

Comments
 (0)