Thread: Silent Data Manipulation - Time(stamp) w/o Time Zone Literals w/ TZ

Silent Data Manipulation - Time(stamp) w/o Time Zone Literals w/ TZ

From
"David G. Johnston"
Date:
<div dir="ltr"><div class="gmail_default" style="style"><div class="gmail_default" style="style"><span
style="font-family:arial,helvetica,sans-serif">​"​Ina literal that has been determined to be timestamp without time
zone,PostgreSQL will silently ignore any time zone indication. That is, the resulting value is derived from the
date/timefields in the input value, and is not adjusted for time zone.​​"​</span><br /></div><div class="gmail_default"
style="style"><fontface="arial, helvetica, sans-serif"><br /></font></div><div class="gmail_default"
style="style"><fontface="arial, helvetica, sans-serif"><a
href="http://www.postgresql.org/docs/9.3/static/datatype-datetime.html">http://www.postgresql.org/docs/9.3/static/datatype-datetime.html</a></font></div><div
class="gmail_default"style="style"><font face="arial, helvetica, sans-serif"><br /></font></div><div
class="gmail_default"style="style"><font face="arial, helvetica, sans-serif">8.5.1.3 Time Stamps</font></div><div
class="gmail_default"style="style"><font face="arial, helvetica, sans-serif"><br /></font></div><div
class="gmail_default"style="style"><font face="arial, helvetica, sans-serif"><br /></font></div><div
class="gmail_default"style="style"><font face="arial, helvetica, sans-serif">Not exactly a widely impactful decision
butis there harm in emitting a</font></div><div class="gmail_default" style="style"><font face="arial, helvetica,
sans-serif"><br/></font></div><div class="gmail_default" style="style"><font face="arial, helvetica,
sans-serif">"NOTICE:timezone specification ignored"</font></div><div class="gmail_default" style="style"><br
/></div><divclass="gmail_default" style="style">Just got a complaint on -admin about this:</div><div
class="gmail_default"style="style"><br /></div><div class="gmail_default" style="style"><a
href="http://www.postgresql.org/message-id/CACT-NGKQRtBGKOGUMT_goxyKu=yym8ET1Q5my-yjfuWW++uXbA@mail.gmail.com">http://www.postgresql.org/message-id/CACT-NGKQRtBGKOGUMT_goxyKu=yym8ET1Q5my-yjfuWW++uXbA@mail.gmail.com</a><br
/></div><divclass="gmail_default" style="style"><br /></div><div class="gmail_default" style="style">David J.</div><div
class="gmail_default"style="style"><br /></div></div></div> 

Re: Silent Data Manipulation - Time(stamp) w/o Time Zone Literals w/ TZ

From
Robert Haas
Date:
On Tue, May 12, 2015 at 1:57 PM, David G. Johnston
<david.g.johnston@gmail.com> wrote:
> "In a literal that has been determined to be timestamp without time zone,
> PostgreSQL will silently ignore any time zone indication. That is, the
> resulting value is derived from the date/time fields in the input value, and
> is not adjusted for time zone."
>
> http://www.postgresql.org/docs/9.3/static/datatype-datetime.html
>
> 8.5.1.3 Time Stamps
>
> Not exactly a widely impactful decision but is there harm in emitting a
>
> "NOTICE: timezone specification ignored"

Well, it could emit a catastrophic amount of log chatter.  Try doing a
bulk load into a table with a column of that type.

In general, I'm not a big fan of accepting things and ignoring them.
We've prided ourselves on having tighter data type checking than
pretty much any other database product out there, but somehow we still
have edge cases like this floating around.

-- 
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company