aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHeikki Linnakangas <heikki.linnakangas@iki.fi>2009-07-06 19:11:46 +0000
committerHeikki Linnakangas <heikki.linnakangas@iki.fi>2009-07-06 19:11:46 +0000
commit4735800188ac9f313173c36dd2bcd589bf9abff3 (patch)
treeba2fb300f5cd8bfc9fea6020ccdcb44aa28a8eee
parentc75235949a52f7ef69ea0f0fd48d5f1d85c35ccc (diff)
downloadpostgresql-4735800188ac9f313173c36dd2bcd589bf9abff3.tar.gz
postgresql-4735800188ac9f313173c36dd2bcd589bf9abff3.zip
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.
-rw-r--r--src/backend/utils/adt/formatting.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/backend/utils/adt/formatting.c b/src/backend/utils/adt/formatting.c
index 66e75995fd0..f8e61b02c39 100644
--- a/src/backend/utils/adt/formatting.c
+++ b/src/backend/utils/adt/formatting.c
@@ -1,7 +1,7 @@
/* -----------------------------------------------------------------------
* formatting.c
*
- * $PostgreSQL: pgsql/src/backend/utils/adt/formatting.c,v 1.158 2009/06/22 17:54:30 tgl Exp $
+ * $PostgreSQL: pgsql/src/backend/utils/adt/formatting.c,v 1.158.2.1 2009/07/06 19:11:46 heikki Exp $
*
*
* 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)
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: