Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1YpeTb-0004E2-PM for pgsql-admin@arkaria.postgresql.org; Tue, 05 May 2015 15:09:39 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1YpeTb-0000iB-7r for pgsql-admin@arkaria.postgresql.org; Tue, 05 May 2015 15:09:39 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1YpeTa-0000i5-If for pgsql-admin@postgresql.org; Tue, 05 May 2015 15:09:38 +0000 Received: from moh1-ve1.go2.pl ([193.17.41.131]) by magus.postgresql.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84) (envelope-from ) id 1YpeTT-0002MS-NE for pgsql-admin@postgresql.org; Tue, 05 May 2015 15:09:37 +0000 Received: from moh1-ve1.go2.pl (unknown [10.0.0.131]) by moh1-ve1.go2.pl (Postfix) with ESMTP id 10BDE91F808; Tue, 5 May 2015 17:09:19 +0200 (CEST) Received: from o2.pl (unknown [10.0.0.140]) by moh1-ve1.go2.pl (Postfix) with SMTP; Tue, 5 May 2015 17:09:18 +0200 (CEST) Subject: =?UTF-8?Q?Re:_display_to=5Ftimestamp?= =?UTF-8?Q?_in_quotas_or_convert_to_char_=3F?= From: =?UTF-8?Q?czezz?= To: =?UTF-8?Q?Scott_Ribe?= Cc: =?UTF-8?Q?Albe_Laurenz?=, =?UTF-8?Q?Postgres_Maillist?= In-Reply-To: References: <22c93a48.7dc1250c.5548946d.f29b0@o2.pl> <79bfc5f9.244b3aa3.5548d1d4.9c8af@o2.pl> Mime-Version: 1.0 Message-ID: <5d1b4284.53c7658d.5548dd1d.bf503@o2.pl> Date: Tue, 05 May 2015 17:09:17 +0200 X-Originator: 84.74.156.204 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable 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 Hi, ya, that is the background of this story.=20 There is one internal app in my company that frequently runs into specific = error - related to that query. Its actually not Devs team who reject to look at this but support team (whi= ch is one step before devs) So, now showing them this same query with added to_char() they should "shut= -the-front-door" and send it to correction. ...though its really difficult with them. Anyway thank you all for your help :) BR, czezz Dnia 5 maja 2015 16:47 Scott Ribe napisa=C5= =82(a): > 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. >=20 > So you were really looking for an explanation of why it didn=E2=80=99t wo= rk, in order to pass along to people whom you=E2=80=99re having trouble con= vincing? OK, didn=E2=80=99t get that from your post, now it makes sense. It= just seemed odd that you seemed to be ignoring the most correct (and easy)= solution ;-) >=20 > Anyway, now the we understand that=E2=80=A6 PostgreSQL used to be more ag= gressive about automatically casting text types to more specific types. I s= uspect, though I don=E2=80=99t recall for sure, that this query would have = worked on some earlier versions. Later versions removed some of the automat= ic casting, because it was found that those casts caused problems=E2=80=94t= hat sometimes they would cause accidental type mismatches to be executed in= stead of flagged, and produce incorrect results instead of an error message= , so the decision was made that if you want to compare mismatched types, yo= u have to be explicit about it. >=20 >=20 --=20 Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-admin