projects
/
users
/
bernd
/
postgres.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
5086dfc
)
to_char(): have format 'OF' only show the leading negative sign
author
Bruce Momjian
<
[email protected]
>
Wed, 29 Apr 2015 01:02:57 +0000
(21:02 -0400)
committer
Bruce Momjian
<
[email protected]
>
Wed, 29 Apr 2015 01:02:57 +0000
(21:02 -0400)
Previously both hours and minutes displayed as negative.
Report by David Pozsar
src/backend/utils/adt/formatting.c
patch
|
blob
|
blame
|
history
diff --git
a/src/backend/utils/adt/formatting.c
b/src/backend/utils/adt/formatting.c
index 40a353f5134cb7766ed567ef9b975bb530b1f6fe..576db95c1bed53508d274718c0650e353376735c 100644
(file)
--- a/
src/backend/utils/adt/formatting.c
+++ b/
src/backend/utils/adt/formatting.c
@@
-2507,7
+2507,7
@@
DCH_to_char(FormatNode *node, bool is_interval, TmToChar *in, char *out, Oid col
s += strlen(s);
if (tm->tm_gmtoff % SECS_PER_HOUR != 0)
{
- sprintf(s, ":%02ld", (tm->tm_gmtoff % SECS_PER_HOUR) / SECS_PER_MINUTE);
+ sprintf(s, ":%02ld",
abs
(tm->tm_gmtoff % SECS_PER_HOUR) / SECS_PER_MINUTE);
s += strlen(s);
}
break;