Re: timetz storage vs timestamptz
От | Jim Nasby |
---|---|
Тема | Re: timetz storage vs timestamptz |
Дата | |
Msg-id | 731838C0-A99A-4D39-A894-9DA87A081666@enterprisedb.com обсуждение исходный текст |
Ответ на | Re: timetz storage vs timestamptz (Tom Lane <tgl@sss.pgh.pa.us>) |
Список | pgsql-hackers |
On Oct 3, 2006, at 5:32 PM, Tom Lane wrote: > "Jim C. Nasby" <jim@nasby.net> writes: >> Why is it timestamptz can store a date and time to 1 microsecond in 8 >> bytes but a timetz needs 12 to store just the time to 1 microsecond? > > It's tracking the timezone explicitly ... something that timestamptz > really ought to do too. Wow, the docs are totally unclear on that. I believe that explains bug 2661. Yes, it would be nice to store the timezone in timestamptz or an equivalent, but there's also a use for the current behavior. In many cases, you don't care what the original timezone was; you just want to make sure that everything is getting stored in UTC (and then converted to your local timezone on the way back out). I'm thinking time[stamp], time[stamp]tz (which should do what timetz does), and time[stamp]utc (doing what timestamptz does). In the meantime I'll try and clarify the docs on this. -- Jim Nasby jimn@enterprisedb.com EnterpriseDB http://enterprisedb.com 512.569.9461 (cell)
В списке pgsql-hackers по дате отправления: