Re: storing TZ along timestamps
От | Josh Berkus |
---|---|
Тема | Re: storing TZ along timestamps |
Дата | |
Msg-id | 4E24B59B.5020909@agliodbs.com обсуждение исходный текст |
Ответ на | Re: storing TZ along timestamps (Jim Nasby <jim@nasby.net>) |
Ответы |
Re: storing TZ along timestamps
Re: storing TZ along timestamps |
Список | pgsql-hackers |
Jim, > Right; you need a timestamp and you need to know what timezone that timestamp was entered in. That means you can alwaysconvert that time to whatever timezone you'd like (like timestamptz), but you also know what time was originally entered,and what timezone it was entered in. Technically you can do that with a separate field, but that seems really uglyto me. I disagree. It's a good mapping of the actual data. The timestamp and the timezone in which that timestamp was entered are two separate pieces of data and *ought* to be in two separate fields. For one thing, the question of "what timezone was this entered in" is an application-specific question, since you have three different potential timezones: * the actual client timezone * the actual server timezone * the application timezone if the application has configurable timezones In a builtin data type, which of those three would you pick? Only the application knows. Additionally, if you have your timestamp-with-original-timezone data type, then you're going to need to recode every single timestamp-handling function and operator to handle the new type. -- Josh Berkus PostgreSQL Experts Inc. http://pgexperts.com
В списке pgsql-hackers по дате отправления: