Re: [BUGS] BUG #14842: TIMESTAMP WITH TIME ZONE and TIMESTAMP WITHOUTTIMEZONE should not be comparable

Поиск
Список
Период
Сортировка
От David G. Johnston
Тема Re: [BUGS] BUG #14842: TIMESTAMP WITH TIME ZONE and TIMESTAMP WITHOUTTIMEZONE should not be comparable
Дата
Msg-id CAKFQuwYGq5QnzVcy=gU-jsTGqyJ+1wtGEAW-ehYgsBMzs1EU_g@mail.gmail.com
обсуждение исходный текст
Ответ на [BUGS] BUG #14842: TIMESTAMP WITH TIME ZONE and TIMESTAMP WITHOUT TIMEZONEshould not be comparable  (edpeur@gmail.com)
Ответы Re: [BUGS] BUG #14842: TIMESTAMP WITH TIME ZONE and TIMESTAMP WITHOUT TIMEZONE should not be comparable
Список pgsql-bugs
On Tue, Oct 3, 2017 at 12:52 PM, <edpeur@gmail.com> wrote:
The following bug has been logged on the website:

Bug reference:      14842
Logged by:          Eduardo Perez
Email address:      edpeur@gmail.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

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

I was curious whether something like "ALTER CAST ... NO IMPLICIT" would work but alas no such feature presently exists.

David J.

В списке pgsql-bugs по дате отправления:

Предыдущее
От: edpeur@gmail.com
Дата:
Сообщение: [BUGS] BUG #14842: TIMESTAMP WITH TIME ZONE and TIMESTAMP WITHOUT TIMEZONEshould not be comparable
Следующее
От: Tom Lane
Дата:
Сообщение: Re: [BUGS] BUG #14842: TIMESTAMP WITH TIME ZONE and TIMESTAMP WITHOUT TIMEZONE should not be comparable