Re: Potential bug in postgres 8.2.4

From: Tomas Doran <bobtfish(at)bobtfish(dot)net>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Richard Huxton <dev(at)archonet(dot)com>, Marcin Stępnicki <mstepnicki(at)gmail(dot)com>, pgsql-sql(at)postgresql(dot)org
Subject: Re: Potential bug in postgres 8.2.4
Date: 2007-05-24 15:19:50
Message-ID: 80B9155B-668A-4295-8AF4-707AD01409EA@bobtfish.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql


On 24 May 2007, at 15:51, Tom Lane wrote:

> Tomas Doran <bobtfish(at)bobtfish(dot)net> 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:

<snip>

That's no bad thing.

> 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.

I wasn't suggesting reverting it - just that lists of one element
being treated differently to lists of >1 element is not what I
expected :)

> Fix your code.

Easier said than done, but thankfully also not strictly my problem.

We have found that a newer database driver version does 'the right
thing' for us by quoting the values in the IN () list.

Our reason for not upgrading is that this driver connects using the
v8 protocol, and ergo logs an error when connecting to our legacy
postgres 7.2 databases (the error is logged in the DB backend as it
doesn't understand the v8 protocol). Yes, we are a million years
behind in upgrading - it's underway currently...

The number of machines using the db / making connections causes the
volumes of errors seen in the server logs to go totally mental, so we
can't use the new driver with the legacy DBs

The current plan is to rebuild our 7.2 server to just remove this
error message, and upgrade the database driver - as that wins us a
lot of other things too.

Thanks for the swift and comprehensive response guys!

Cheers
Tom

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message chester c young 2007-05-24 18:15:12 off topic
Previous Message Tom Lane 2007-05-24 14:51:01 Re: Potential bug in postgres 8.2.4