BUG #14842: TIMESTAMP WITH TIME ZONE and TIMESTAMP WITHOUT TIMEZONE should not be comparable

From: edpeur(at)gmail(dot)com
To: pgsql-bugs(at)postgresql(dot)org
Cc: edpeur(at)gmail(dot)com
Subject: BUG #14842: TIMESTAMP WITH TIME ZONE and TIMESTAMP WITHOUT TIMEZONE should not be comparable
Date: 2017-10-03 19:52:08
Message-ID: 20171003195208.28557.28195@wrigleys.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

The following bug has been logged on the website:

Bug reference: 14842
Logged by: Eduardo Perez
Email address: edpeur(at)gmail(dot)com
PostgreSQL version: Unsupported/Unknown
Operating system: All
Description:

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

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message David G. Johnston 2017-10-03 20:20:40 Re: BUG #14842: TIMESTAMP WITH TIME ZONE and TIMESTAMP WITHOUT TIMEZONE should not be comparable
Previous Message David G. Johnston 2017-10-03 19:50:28 Re: BUG #14841: Remove TIME WITH TIME ZONE type