Skip to content

Commit 9524c6b

Browse files
committed
Repair two TIME WITH TIME ZONE bugs found by Dennis Vshivkov. Comparison
of timetz values misbehaved in --enable-integer-datetime cases, and EXTRACT(EPOCH) subtracted the zone instead of adding it in all cases. Backpatch to all supported releases (except --enable-integer-datetime code does not exist in 7.2).
1 parent 6fbda16 commit 9524c6b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/backend/utils/adt/date.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $Header: /cvsroot/pgsql/src/backend/utils/adt/date.c,v 1.64.2.3 2002/09/30 20:57:10 tgl Exp $
11+
* $Header: /cvsroot/pgsql/src/backend/utils/adt/date.c,v 1.64.2.4 2005/04/23 22:54:23 tgl Exp $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
@@ -1553,7 +1553,7 @@ timetz_part(PG_FUNCTION_ARGS)
15531553
}
15541554
}
15551555
else if ((type == RESERV) && (val == DTK_EPOCH))
1556-
result = time->time - time->zone;
1556+
result = time->time + time->zone;
15571557
else
15581558
{
15591559
elog(ERROR, "TIMETZ units '%s' not recognized",

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy