Received: from localhost (maia-4.hub.org [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id 817A89FBEA8 for ; Thu, 24 May 2007 11:51:45 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 93450-03 for ; Thu, 24 May 2007 11:51:38 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.4 Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by postgresql.org (Postfix) with ESMTP id 20BB59FBD26 for ; Thu, 24 May 2007 11:51:36 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.1/8.14.1) with ESMTP id l4OEp1GI004558; Thu, 24 May 2007 10:51:02 -0400 (EDT) To: Tomas Doran cc: Richard Huxton , =?UTF-8?Q?Marcin_St=C4=99pnicki?= , pgsql-sql@postgresql.org Subject: Re: Potential bug in postgres 8.2.4 In-reply-to: References: <3D2864D1-BF64-4609-B307-1C70A4FE503F@bobtfish.net> <72573535-0946-45DE-B5E4-E57236965B0E@bobtfish.net> <465582E1.3030409@archonet.com> Comments: In-reply-to Tomas Doran message dated "Thu, 24 May 2007 13:34:10 +0100" Date: Thu, 24 May 2007 10:51:01 -0400 Message-ID: <4557.1180018261@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200705/171 X-Sequence-Number: 28451 Tomas Doran writes: > The tightening in general is biting me, but if the answer was 'it was > deliberate tightening', and the behavior was consistent, then we'd > have just dealt with it - it's the in-consistent behavior that makes > me think this is a bug (or at least a gotcha, as it's not what you > expect)... The direction of the future is that *all* those queries are going to fail, because they're relying on an implicit integer-to-text conversion, and its days are numbered. That might happen as soon as 8.3: http://archives.postgresql.org/pgsql-hackers/2007-04/msg00017.php but it's been on the radar screen for a very long time, eg http://archives.postgresql.org/pgsql-bugs/2001-10/msg00108.php http://archives.postgresql.org/pgsql-hackers/2002-04/msg00450.php http://archives.postgresql.org/pgsql-sql/2004-01/msg00064.php http://archives.postgresql.org/pgsql-hackers/2005-11/msg00510.php I think the reason this particular behavior changed in 8.2 is the re-implementation of multi-element IN tests as ScalarArrayOps; but it's part of an intentional long-term tightening of SQL semantics, and you're not going to get far with a proposal to revert it. Fix your code. regards, tom lane