aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2005-04-23 22:54:23 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2005-04-23 22:54:23 +0000
commit9524c6b8aedecfcea77287b4f6452288dcf8dc7a (patch)
tree90ef5f19280728649b389b06128f557adc7257b2
parent6fbda165183f9164d111f2562c7d2ae480049c23 (diff)
downloadpostgresql-9524c6b8aedecfcea77287b4f6452288dcf8dc7a.tar.gz
postgresql-9524c6b8aedecfcea77287b4f6452288dcf8dc7a.zip
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).
-rw-r--r--src/backend/utils/adt/date.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/backend/utils/adt/date.c b/src/backend/utils/adt/date.c
index 03051dd4b19..f14d2f7a7b2 100644
--- a/src/backend/utils/adt/date.c
+++ b/src/backend/utils/adt/date.c
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/utils/adt/date.c,v 1.64.2.3 2002/09/30 20:57:10 tgl Exp $
+ * $Header: /cvsroot/pgsql/src/backend/utils/adt/date.c,v 1.64.2.4 2005/04/23 22:54:23 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -1553,7 +1553,7 @@ timetz_part(PG_FUNCTION_ARGS)
}
}
else if ((type == RESERV) && (val == DTK_EPOCH))
- result = time->time - time->zone;
+ result = time->time + time->zone;
else
{
elog(ERROR, "TIMETZ units '%s' not recognized",