The assumtion that char and varchar can be compared is gone.  Any comparison
or in this case concatination between the two types needs to be explicitly
cast.

try
SELECT code::varchar || ' ' || diag::varchar, code
FROM dsm4
WHERE axis = 1
ORDER BY code;

Thanks
Chad
----- Original Message -----
From: "Thomas Good" <[EMAIL PROTECTED]>
To: "Postgres SQL List" <[EMAIL PROTECTED]>
Sent: Tuesday, March 25, 2003 3:28 PM
Subject: [SQL] Concatenation Snafu



SELECT code || ' ' || diag, code
FROM dsm4
WHERE axis = 1
ORDER BY code;

This worked on 6.3-7.3.1 now it dies with:
'unable to identify an operator || for types 'character' and 'character
varying'

What happened?????

-----------------------------------------------------------------------
Thomas Good                                  e-mail: [EMAIL PROTECTED]
Programmer/Analyst                           phone:   (+1) 718.818.5528
Residential Services                         fax:     (+1) 718.818.5056
Behavioral Health Services, SVCMC-NY         mobile:  (+1) 917.282.7359

// Krieg ist selbst Terror - Für Frieden und globale Gerechtigkeit!


---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command
    (send "unregister YourEmailAddressHere" to [EMAIL PROTECTED])


---------------------------(end of broadcast)---------------------------
TIP 6: Have you searched our list archives?

http://archives.postgresql.org

Reply via email to