Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1Ype8V-0002zS-5O for pgsql-admin@arkaria.postgresql.org; Tue, 05 May 2015 14:47:51 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1Ype8U-0007Y3-9l for pgsql-admin@arkaria.postgresql.org; Tue, 05 May 2015 14:47:50 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1Ype8T-0007Xw-43 for pgsql-admin@postgresql.org; Tue, 05 May 2015 14:47:49 +0000 Received: from mailout.easymail.ca ([64.68.201.169]) by makus.postgresql.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84) (envelope-from ) id 1Ype8Q-0001WQ-EJ for pgsql-admin@postgresql.org; Tue, 05 May 2015 14:47:47 +0000 Received: from localhost (localhost [127.0.0.1]) by mailout.easymail.ca (Postfix) with ESMTP id E627BE349; Tue, 5 May 2015 10:47:44 -0400 (EDT) X-Virus-Scanned: Debian amavisd-new at mailout.easymail.ca X-Spam-Flag: NO X-Spam-Score: -3.908 X-Spam-Level: X-Spam-Status: No, score=-3.908 required=5 tests=[ALL_TRUSTED=-1.8, AWL=-0.201, BAYES_00=-2.599, DNS_FROM_AHBL_RHSBL=0.692] Received: from mailout.easymail.ca ([127.0.0.1]) by localhost (easymail-mailout.easydns.vpn [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id bB-xy8FPt3CE; Tue, 5 May 2015 10:47:44 -0400 (EDT) Received: from [192.168.2.16] (unknown [8.39.228.5]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mailout.easymail.ca (Postfix) with ESMTPSA id 2AB82E343; Tue, 5 May 2015 10:47:44 -0400 (EDT) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2098\)) Subject: Re: display to_timestamp in quotas or convert to char ? From: Scott Ribe In-Reply-To: <79bfc5f9.244b3aa3.5548d1d4.9c8af@o2.pl> Date: Tue, 5 May 2015 08:47:38 -0600 Cc: Albe Laurenz , Postgres Maillist Content-Transfer-Encoding: quoted-printable Message-Id: References: <22c93a48.7dc1250c.5548946d.f29b0@o2.pl> <70aed348.7ad50e54.5548c47d.1e1de@o2.pl> <79bfc5f9.244b3aa3.5548d1d4.9c8af@o2.pl> To: czezz X-Mailer: Apple Mail (2.2098) X-Pg-Spam-Score: -2.6 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-admin Precedence: bulk Sender: pgsql-admin-owner@postgresql.org On May 5, 2015, at 8:21 AM, czezz wrote: >=20 > This is because this query is executed/hardcoded in application. > And by executing it like this I can prove devs that there is a problem. So you were really looking for an explanation of why it didn=E2=80=99t work= , in order to pass along to people whom you=E2=80=99re having trouble convi= ncing? OK, didn=E2=80=99t get that from your post, now it makes sense. It j= ust seemed odd that you seemed to be ignoring the most correct (and easy) s= olution ;-) Anyway, now the we understand that=E2=80=A6 PostgreSQL used to be more aggr= essive about automatically casting text types to more specific types. I sus= pect, though I don=E2=80=99t recall for sure, that this query would have wo= rked on some earlier versions. Later versions removed some of the automatic= casting, because it was found that those casts caused problems=E2=80=94tha= t sometimes they would cause accidental type mismatches to be executed inst= ead of flagged, and produce incorrect results instead of an error message, = so the decision was made that if you want to compare mismatched types, you = have to be explicit about it. --=20 Scott Ribe scott_ribe@elevated-dev.com http://www.elevated-dev.com/ https://www.linkedin.com/in/scottribe/ (303) 722-0567 voice --=20 Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-admin