Subject: 8.3 vs 8.2 sql compatiblity issue
From: tgl@sss.pgh.pa.us (Tom Lane)
Date: 11/15/2007 1:17:20 PM
"Joshua D. Drake" <jd@commandprompt.com> writes:
> Tony Caduto <tony_caduto@amsoftwaredesign.com> wrote:
>> I am actually getting a lot of these operator does not exist errors
>> in 8.3 another one I get is operator does not exist for char=integer
> This appears to be a classic example of:
> Casts to text that formerly occurred implicitly may now need to be
> written explicitly
That's no doubt got something to do with it, but I think Tony is mighty
confused about exactly what is failing. pg_constraint.conkey is not
text, for instance; it's smallint[] and so the quoted bit should still
work just fine. I'd suggest trying the query in some client that gives
you an error location pointer, which whatever he's using evidently does
not.
regards, tom lane
---------------------------(end of broadcast)---------------------------
TIP 6: explain analyze is your friend
Subject: 8.3 vs 8.2 sql compatiblity issue
From: tgl@sss.pgh.pa.us (Tom Lane)
Date: 11/15/2007 4:00:34 PM
Tony Caduto <tony_caduto@amsoftwaredesign.com> writes:
> it was this line:
> case when a.attnum as text IN( select array_to_string(conkey,',') from
> pg_constraint where
> which is fixed by adding a cast:
> case when cast(a.attnum as text) IN( select array_to_string(conkey,',')
> from pg_constraint where
Surely that's the worst bit of SQL code I've seen in awhile. Why
*weren't* you using "a.attnum = any(conkey)"?? Performing this
operation textually is simply bogus.
regards, tom lane
---------------------------(end of broadcast)---------------------------
TIP 4: Have you searched our list archives?
http://archives.postgresql.org/
|