Re: Why data of timestamptz does not store value of timezone passed to it?
От
David G Johnston
Тема
Re: Why data of timestamptz does not store value of timezone passed
to it?
Дата
Msg-id
1409233291972-5816737.post@n5.nabble.com
Ответ на
Список
Дерево обсуждения
Why data of timestamptz does not store value of timezone passed to
it? rohtodeveloper <rohtodeveloper@outlook.com>
Re: Why data of timestamptz does not store value of timezone passed
to it? David G Johnston <david.g.johnston@gmail.com>
Re: Why data of timestamptz does not store value of timezone
passed to it? Steve Crawford <scrawford@pinpointresearch.com>
Re: Why data of timestamptz does not store value of timezone passed to it? Kevin Grittner <kgrittn@ymail.com>
Re: Why data of timestamptz does not store value of
timezone passed to it? Bruce Momjian <bruce@momjian.us>
Re: Why data of timestamptz does not store value of
timezone passed to it? "ktm@rice.edu" <ktm@rice.edu>
Re: Why data of timestamptz does not store value of timezone passed to it? Kevin Grittner <kgrittn@ymail.com>
Re: Why data of timestamptz does not store value of
timezone passed to it? Alvaro Herrera <alvherre@2ndquadrant.com>
Re: Why data of timestamptz does not store value of timezone passed to it? Kevin Grittner <kgrittn@ymail.com>
Re: Why data of timestamptz does not store value of timezone passed to it? Tom Lane <tgl@sss.pgh.pa.us>
Re: Why data of timestamptz does not store value of timezone passed to it? Kevin Grittner <kgrittn@ymail.com>
Re: Why data of timestamptz does not store value of timezone passed to it? Tom Lane <tgl@sss.pgh.pa.us>
Re: Why data of timestamptz does not store value of timezone passed
to it? Greg Stark <stark@mit.edu>
Re: Why data of timestamptz does not store value of timezone passed
to it? David G Johnston <david.g.johnston@gmail.com>
Re: Why data of timestamptz does not store value of timezone passed
to it? Greg Stark <stark@mit.edu>
Re: Re: Why data of timestamptz does not store value of
timezone passed to it? Peter Eisentraut <peter_e@gmx.net>
Re: Why data of timestamptz does not store value of
timezone passed to it? Alvaro Herrera <alvherre@2ndquadrant.com>
Re: Why data of timestamptz does not store value of timezone passed to it? Kevin Grittner <kgrittn@ymail.com>
Re: Why data of timestamptz does not store value of timezone
passed to it? Craig Ringer <craig@2ndquadrant.com>
Re: Why data of timestamptz does not store value of
timezone passed to it? Gianni Ciolli <gianni.ciolli@2ndquadrant.it>
Re: Why data of timestamptz does not store value of
timezone passed to it? rohtodeveloper <rohtodeveloper@outlook.com>
Re: Why data of timestamptz does not store value of timezone passed to it? Tom Lane <tgl@sss.pgh.pa.us>
Re: Why data of timestamptz does not store value of timezone
passed to it? arhipov <arhipov@dc.baikal.ru>
Re: Why data of timestamptz does not store value of
timezone passed to it? Pavel Stehule <pavel.stehule@gmail.com>
rohtodeveloper wrote > I have a question about data type "timestamp with time zone". > Why data of timestamptz does not store value of timezone passed to it? > > The timezone of output(+08) is different with the original input > value(+02). > It seems not to be good behavior. Its good for the inumerable people who use it every day without difficulty... The why is that the goal of timestamptz is to represent a single point-in-time. For all practical purposes the introduction of timezones simply allows for multiple equivalent representations of said point. Postgres has simply chosen UTC as the canonical representation for storage purposes and uses client-provided timezone information to transform the stored valued into the equivalent representation that is thought to be most useful to the user. > But the behavior of date type "time with time zone" is correct. > > postgres=# select '14:30:30.423602+02'::time with time zone; > timetz > -------------------- > 14:30:30.423602+02 > (1 row) Inconsistent (wrt timestamptz), and possibly buggy (though doubtful, consistency is not mandatory), but the documentation itself says that "time with time zone" has problematic properties mandated by the SQL standard. The issue is that without knowing the date within a given timezone one does not know the adjustment value to use. TimeZones are inherently date dependent - so timetz is fundamentally flawed even if it can be used to good effect in limited situations. If this does what you need then create a composite type (date, timetz). Once you starting doing modifications to your custom type you will likely find the timestamptz behavior to be more useful and accurate. > If the corrent behavior of timestamptz is not suitable,is there any plan > to correct the behavior of timestamptz or create a new data type which can > store timestamp with timezone? Timestamptz will never be changed from its current behavior. The bar to introduce another timestamptz-like data type with different behavior is extremely high. It would probably be worthwhile for everyone if you share what you are actually trying to accomplish instead of just throwing out the claim that the data type is broken. David J. -- View this message in context: http://postgresql.1045698.n5.nabble.com/Why-data-of-timestamptz-does-not-store-value-of-timezone-passed-to-it-tp5816703p5816737.html Sent from the PostgreSQL - hackers mailing list archive at Nabble.com.
В списке pgsql-hackers по дате отправления