Re: Fwd: patch: make_timestamp function - Mailing list pgsql-hackers

From Pavel Stehule
Subject Re: Fwd: patch: make_timestamp function
Date
Msg-id CAFj8pRBuvDfp2ZCN_uCOnjyK5mN2dPgZ4TMK7gt6K8xcRFtp2A@mail.gmail.com
Whole thread Raw
In response to Re: Fwd: patch: make_timestamp function  (Alvaro Herrera <alvherre@2ndquadrant.com>)
List pgsql-hackers
<p dir="ltr"><br /> Dne 19. 2. 2014 21:20 "Alvaro Herrera" <<a
href="mailto:alvherre@2ndquadrant.com">alvherre@2ndquadrant.com</a>>napsal(a):<br /> ><br /> > Pavel Stehule
escribió:<br/> ><br /> > > I though about it, and now I am thinking so timezone in format<br /> > >
'Europe/Prague'is together with time ambiguous<br /> > ><br /> > > We can do it, but we have to expect so
calculationwill be related to<br /> > > current date - and I am not sure if it is correct, because someone can<br
/>> > write some like<br /> > ><br /> > > make_date(x,x,x) + make_timetz(..) - and result will be
damaged.<br/> ><br /> > Hmm, I see your point --- the make_timetz() call would use today's<br /> > timezone
displacement,which might be different from the one used in the<br /> > make_date() result.  That would result in a
botchedtimestamptz<br /> > sometimes, but it might escape testing because it's subtle and depends<br /> > on the
inputdata.<br /> ><br /> > However, your proposal is to use an abbreviation timezone, thereby<br /> > forcing
theuser to select the correct timezone i.e. the one that<br /> > matches the make_date() arguments.  I'm not sure
thisis much of an<br /> > improvement, because then the user is faced with the difficult problem<br /> > of
figuringout the correct abbreviation in the first place.<br /> ><br /> > I think there is little we can do to
solvethe problem at this level; it<br /> > seems to me that the right solution here is to instruct users to use<br
/>> make_date() only in conjunction with make_time(), that is, produce a<br /> > timezone-less timestamp; and
thenapply a AT TIME ZONE operator to the<br /> > result.  That could take a full timezone name, and that would
always<br/> > work correctly.<br /> ><br /> > My conclusion here is that the "time with time zone" datatype is
broken<br/> > in itself, because of this kind of ambiguity.  Maybe we should just<br /> > avoid offering more
functionalityon top of it, that is get rid of<br /> > make_timetz() in this patch?<br /> ><p dir="ltr">+1<p
dir="ltr">Pavel<br/> > --<br /> > Álvaro Herrera                <a
href="http://www.2ndQuadrant.com/">http://www.2ndQuadrant.com/</a><br/> > PostgreSQL Development, 24x7 Support,
Training& Services<br /> 

pgsql-hackers by date:

Previous
From: Alvaro Herrera
Date:
Subject: Re: Fwd: patch: make_timestamp function
Next
From: Tom Lane
Date:
Subject: Re: Fwd: patch: make_timestamp function