Re: type casting in 8.3

From: Alban Hertroys <dalroi(at)solfertje(dot)student(dot)utwente(dot)nl>
To: thefronny(at)gmail(dot)com
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: type casting in 8.3
Date: 2008-02-12 12:37:46
Message-ID: 41C03BB2-BEF9-42FC-8A24-66ECF00A1F49@solfertje.student.utwente.nl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Feb 12, 2008, at 2:55 AM, thefronny(at)gmail(dot)com wrote:

> On Feb 11, 3:15 am, "${spencer}" <spenc(dot)(dot)(dot)(at)gmail(dot)com> wrote:
>> I just literally ran my first search of the day and got the same
>> error.
>>
>> i changed my query so that the integer was cast into text and then it
>> worked fine.
>>
>> thefro(dot)(dot)(dot)(at)gmail(dot)com wrote:

> Ya know, I found and fixed my problem today at work. I just explicitly
> cast everything in the query and as I worked my way through it I
> watched how the error message changed. At the very end I came up to
> something like "...and store != $store". I changed it to "...and
> store != '$store'" and, bingo the query worked again. Then I backed
> out all the :: casting I had done and everything still worked. 'magine
> that.

Maybe the two of you should be wondering why you're comparing text to
integer values? Something is wrong there in your design, obviously.
You could be in for some unpleasant surprises, for example wrt
ordering (1, 2, 10 vs '1', '10', '2').

Alban Hertroys

--
If you can't see the forest for the trees,
cut the trees and you'll see there is no forest.

!DSPAM:737,47b18f65233091858395181!

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Dave Cramer 2008-02-12 13:24:53 deadlock while re-indexing table
Previous Message Richard Huxton 2008-02-12 10:39:05 Re: TSearch2 Migration Guide from 8.2 to 8.3