Re: [BUGS] BUG #14842: TIMESTAMP WITH TIME ZONE and TIMESTAMP WITHOUT TIMEZONE should not be comparable
| От | Tom Lane |
|---|---|
| Тема | Re: [BUGS] BUG #14842: TIMESTAMP WITH TIME ZONE and TIMESTAMP WITHOUT TIMEZONE should not be comparable |
| Дата | |
| Msg-id | 30437.1507063123@sss.pgh.pa.us обсуждение |
| Ответ на | Re: [BUGS] BUG #14842: TIMESTAMP WITH TIME ZONE and TIMESTAMP WITHOUTTIMEZONE should not be comparable ("David G. Johnston" <david.g.johnston@gmail.com>) |
| Ответы |
Re: [BUGS] BUG #14842: TIMESTAMP WITH TIME ZONE and TIMESTAMP WITHOUTTIMEZONE should not be comparable
|
| Список | pgsql-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
В списке pgsql-bugs по дате отправления: