pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: David G. Johnston <david.g.johnston@gmail.com>
Cc: edpeur@gmail.com, "pgsql-bugs@postgresql.org" <pgsql-bugs@postgresql.org>
Subject: Re: BUG #14842: TIMESTAMP WITH TIME ZONE and TIMESTAMP WITHOUT TIMEZONE should not be comparable
Date: Tue, 03 Oct 2017 16:38:43 -0400
Message-ID: <30437.1507063123@sss.pgh.pa.us> (raw)
In-Reply-To: <CAKFQuwYGq5QnzVcy=gU-jsTGqyJ+1wtGEAW-ehYgsBMzs1EU_g@mail.gmail.com>
References: <20171003195208.28557.28195@wrigleys.postgresql.org>
	<CAKFQuwYGq5QnzVcy=gU-jsTGqyJ+1wtGEAW-ehYgsBMzs1EU_g@mail.gmail.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>

"David G. Johnston" <david.g.johnston@gmail.com> writes:
> On Tue, Oct 3, 2017 at 12:52 PM, <edpeur@gmail.com> wrote:
>> Currently you can do:
>> CREATE TABLE t1 (ts TIMESTAMP WITH TIME ZONE NOT NULL,tr TIMESTAMP WITHOUT
>> TIME ZONE NOT NULL);
>> INSERT INTO t1 (ts,tr) VALUES (CURRENT_TIMESTAMP, CURRENT_TIMESTAMP);
>> SELECT * FROM t1 WHERE ts=tr;
>> 
>> But it should fail with:
>> ERROR: operator does not exist: timestamp with time zone = timestamp
>> without time zone
>> Also CURRENT_TIMESTAMP should fail to be inserted into a TIMESTAMP WITHOUT
>> TIME ZONE column
>> ERROR:  column "tr" is of type timestamp without time zone but expression
>> is of type timestamp with time zone

> ​This is working as intended and given the amount of pain removing implicit
> casts​ generally involves it is unlikely to change.

Not to mention that the SQL standard requires these implicit casts to
exist.

			regards, tom lane


-- 
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs



view thread (7+ messages)  latest in thread

Message-ID: <30437.1507063123@sss.pgh.pa.us>
Permalink:  ../30437.1507063123@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/30437.1507063123@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: tgl@sss.pgh.pa.us, david.g.johnston@gmail.com
  Subject: Re: BUG #14842: TIMESTAMP WITH TIME ZONE and TIMESTAMP WITHOUT TIMEZONE should not be comparable
  In-Reply-To: <30437.1507063123@sss.pgh.pa.us>
  References: <20171003195208.28557.28195@wrigleys.postgresql.org> <CAKFQuwYGq5QnzVcy=gU-jsTGqyJ+1wtGEAW-ehYgsBMzs1EU_g@mail.gmail.com> <30437.1507063123@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox