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

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
Cc: "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Silent Data Manipulation - Time(stamp) w/o Time Zone Literals w/ TZ
Date: 2015-05-13 14:02:40
Message-ID: CA+TgmoaHDOSOBm6YU07Y0f53SaHwZgzsEUZGZRub_ULCe1jjoQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, May 12, 2015 at 1:57 PM, David G. Johnston
<david(dot)g(dot)johnston(at)gmail(dot)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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2015-05-13 14:16:39 Re: Default Roles (was: Additional role attributes)
Previous Message Petr Jelinek 2015-05-13 13:45:47 Re: Sequence Access Method WIP