Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dzTyX-00013L-EY for pgsql-bugs@arkaria.postgresql.org; Tue, 03 Oct 2017 20:39:33 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1dzTyW-00088U-Ug for pgsql-bugs@arkaria.postgresql.org; Tue, 03 Oct 2017 20:39:32 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1dzTxp-0006tU-8Y for pgsql-bugs@postgresql.org; Tue, 03 Oct 2017 20:38:49 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1dzTxm-0007v1-0z for pgsql-bugs@postgresql.org; Tue, 03 Oct 2017 20:38:48 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id v93KchET030438; Tue, 3 Oct 2017 16:38:43 -0400 From: Tom Lane To: "David G. Johnston" cc: edpeur@gmail.com, "pgsql-bugs@postgresql.org" Subject: Re: BUG #14842: TIMESTAMP WITH TIME ZONE and TIMESTAMP WITHOUT TIMEZONE should not be comparable In-reply-to: References: <20171003195208.28557.28195@wrigleys.postgresql.org> Comments: In-reply-to "David G. Johnston" message dated "Tue, 03 Oct 2017 13:20:40 -0700" MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-ID: <30436.1507063123.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Tue, 03 Oct 2017 16:38:43 -0400 Message-ID: <30437.1507063123@sss.pgh.pa.us> List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org "David G. Johnston" writes: > On Tue, Oct 3, 2017 at 12:52 PM, wrote: >> Currently you can do: >> CREATE TABLE t1 (ts TIMESTAMP WITH TIME ZONE NOT NULL,tr TIMESTAMP WITHO= UT >> TIME ZONE NOT NULL); >> INSERT INTO t1 (ts,tr) VALUES (CURRENT_TIMESTAMP, CURRENT_TIMESTAMP); >> SELECT * FROM t1 WHERE ts=3Dtr; >>=20 >> But it should fail with: >> ERROR: operator does not exist: timestamp with time zone =3D timestamp >> without time zone >> Also CURRENT_TIMESTAMP should fail to be inserted into a TIMESTAMP WITHO= UT >> TIME ZONE column >> ERROR: column "tr" is of type timestamp without time zone but expression >> is of type timestamp with time zone > =E2=80=8BThis is working as intended and given the amount of pain removin= g implicit > casts=E2=80=8B generally involves it is unlikely to change. Not to mention that the SQL standard requires these implicit casts to exist. regards, tom lane --=20 Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs