Joshua D. Drake [EMAIL PROTECTED] writes:
Tony Caduto [EMAIL PROTECTED] 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
Hi,
Just running some queries that have worked from 7.4 through 8.2 and they
don't seem to work on 8.3.
select case when a.attnum = any(conkey) then true else false end from
pg_constraint where contype = 'p' and conrelid = c.oid
This one is puking on a.attnum = any(conkey)
returns the
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
On Thu, 15 Nov 2007 12:03:27 -0600
Tony Caduto [EMAIL PROTECTED] 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
Tom Lane wrote:
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
Tony Caduto [EMAIL PROTECTED] 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
Tom Lane wrote:
Tony Caduto [EMAIL PROTECTED] writes:
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.
Wow, you really are lucky.
--
Alvaro Herrera