Search Postgresql Archives

Re: type casting in 8.3

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Feb 12, 2008, at 2:55 AM, thefronny@xxxxxxxxx wrote:

On Feb 11, 3:15 am, "${spencer}" <spenc...@xxxxxxxxx> 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...@xxxxxxxxx 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!



---------------------------(end of broadcast)---------------------------
TIP 1: if posting/reading through Usenet, please send an appropriate
      subscribe-nomail command to majordomo@xxxxxxxxxxxxxx so that your
      message can get through to the mailing list cleanly

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux