From 0851a6fbc77e7f1762a2a94d370492f03450e922 Mon Sep 17 00:00:00 2001 From: Bruce Momjian Date: Wed, 15 Jun 2005 00:34:11 +0000 Subject: This patch makes it possible to use the full set of timezones when doing "AT TIME ZONE", and not just the shorlist previously available. For example: SELECT CURRENT_TIMESTAMP AT TIME ZONE 'Europe/London'; works fine now. It will also obey whatever DST rules were in effect at just that date, which the previous implementation did not. It also supports the AT TIME ZONE on the timetz datatype. The whole handling of DST is a bit bogus there, so I chose to make it use whatever DST rules are in effect at the time of executig the query. not sure if anybody is actuallyi *using* timetz though, it seems pretty unpredictable just because of this... Magnus Hagander --- src/backend/utils/adt/nabstime.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/backend/utils/adt/nabstime.c') diff --git a/src/backend/utils/adt/nabstime.c b/src/backend/utils/adt/nabstime.c index bebd3f9d325..d712d9f8b46 100644 --- a/src/backend/utils/adt/nabstime.c +++ b/src/backend/utils/adt/nabstime.c @@ -10,7 +10,7 @@ * * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/utils/adt/nabstime.c,v 1.132 2005/05/26 02:04:13 neilc Exp $ + * $PostgreSQL: pgsql/src/backend/utils/adt/nabstime.c,v 1.133 2005/06/15 00:34:08 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -556,7 +556,7 @@ timestamp_abstime(PG_FUNCTION_ARGS) result = NOSTART_ABSTIME; else if (TIMESTAMP_IS_NOEND(timestamp)) result = NOEND_ABSTIME; - else if (timestamp2tm(timestamp, NULL, tm, &fsec, NULL) == 0) + else if (timestamp2tm(timestamp, NULL, tm, &fsec, NULL, NULL) == 0) { tz = DetermineLocalTimeZone(tm); result = tm2abstime(tm, tz); @@ -632,7 +632,7 @@ timestamptz_abstime(PG_FUNCTION_ARGS) result = NOSTART_ABSTIME; else if (TIMESTAMP_IS_NOEND(timestamp)) result = NOEND_ABSTIME; - else if (timestamp2tm(timestamp, NULL, tm, &fsec, NULL) == 0) + else if (timestamp2tm(timestamp, NULL, tm, &fsec, NULL, NULL) == 0) result = tm2abstime(tm, 0); else { -- cgit v1.2.3