![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
Sorry, hit Sent too early... David Garamond wrote: The Postgres manual says: The AT TIME ZONE construct allows conversions of time stamps to different time zones. I'd guess most people would think what's meant here is something like "unit conversion", and that the timestamp value stays the same (much like 2 feet becomes 24 inches when it's being "converted"). But: # SELECT NOW() = NOW() AT TIME ZONE 'UTC'; ?column? ---------- f (1 row) Compare with: # select timestamptz '2004-11-01 12:00:00-05' = timestamptz '2004-11-01 17:00:00-00'; ?column? ---------- t (1 row) The question is: does AT TIME TIME ZONE already do what it's supposed to do currently? -- dave ---------------------------(end of broadcast)--------------------------- TIP 1: subscribe and unsubscribe commands go to majordomo (AT) postgresql (DOT) org |
|
Patent. n. Genius is 5% inspiration and 95% perspiration. A patent is a tool for doing 5% of the work and then sitting around waiting for someone else to do the other 95% so you can sue them. |
#3
| |||
| |||
|
|
You misunderstand the TIMESTAMP WITH TIMEZONE type, it doesn't store the timezone you gave it, it's just a point in time. Saying AT TIMEZONE just converts it to a TIMESTAMP WITHOUT TIMEZONE with the local time it was in the timezone you gave it. So you are complaring different things. See: |
#4
| |||
| |||
|
|
So the question remains, does AT TIME ZONE already do what it's supposed to do (according to SQL standard, that is) |
|
... will the "converted" timestamp value be the same if compared with '=' operator? |
#5
| |||
| |||
|
|
David Garamond <lists (AT) zara (DOT) 6.isreserved.com> writes: So the question remains, does AT TIME ZONE already do what it's supposed to do (according to SQL standard, that is) It does not really. By my reading of SQL99, the result should always be timestamptz, and the behavior when the input is already timestamptz should be that the new timezone spec is inserted while preserving the same absolute time (UTC-equivalent timestamp). |
|
Certainly not. We can't have timestamptz values that are in fact distinct comparing as equal. My guess is that the sort order for timestamptz should be UTC-equivalent time as major sort key, with equal UTC times sorted somehow on their timezone specs. |
|
Patent. n. Genius is 5% inspiration and 95% perspiration. A patent is a tool for doing 5% of the work and then sitting around waiting for someone else to do the other 95% so you can sue them. |
#6
| |||
| |||
|
|
On Mon, Nov 01, 2004 at 11:00:10AM -0500, Tom Lane wrote: It does not really. By my reading of SQL99, the result should always be timestamptz, and the behavior when the input is already timestamptz should be that the new timezone spec is inserted while preserving the same absolute time (UTC-equivalent timestamp). That's quite a different use of timestamptz. Does the SQL standard decide what defines a timestamp with a timezone, does it only allow the 'number of hours relative to UTC' or does it also allow different places in the world. |
|
That's an interesting one, Is Australia/Sydney before or after Australia/Brisbane. It is questionable if there is any meaningful order to timezones. Alphabetical will make no-one happy, by longatude/latitude is way too complex. Maybe base offset, then alphabetical. |
|
It's a backward incompatable change (or is it?) |
![]() |
| Thread Tools | |
| Display Modes | |
| |