X-Original-To: pgsql-sql@postgreSQL.org Received: from spampd.localdomain (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 7834B475C98 for ; Tue, 25 Mar 2003 18:01:42 -0500 (EST) Received: from utahisp.com (pop3.cyber-wire.com [66.239.12.3]) by postgresql.org (Postfix) with ESMTP id 661E4474E44 for ; Tue, 25 Mar 2003 18:01:40 -0500 (EST) Received: from chad [63.230.8.76] by utahisp.com (SMTPD32-7.14) id AF405CF0160; Tue, 25 Mar 2003 15:59:12 -0700 Message-ID: <049c01c2f322$69ee2e90$32021aac@chad> From: "Chad Thompson" To: "Thomas Good" , "Postgres SQL List" References: Subject: Re: Concatenation Snafu Date: Tue, 25 Mar 2003 16:01:03 -0700 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2720.3000 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 X-Declude-Sender: chad@weblinkservices.com [63.230.8.76] X-Note: This E-mail was scanned by Declude JunkMail (www.declude.com) for spam. Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, hits=-15.5 required=5.0 tests=BAYES_20,ORIGINAL_MESSAGE,REFERENCES,SMTPD_IN_RCVD autolearn=ham version=2.50 X-Spam-Level: X-Spam-Checker-Version: SpamAssassin 2.50 (1.173-2003-02-20-exp) X-Archive-Number: 200303/566 X-Sequence-Number: 12604 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 =3D 1 ORDER BY code; Thanks Chad ----- Original Message ----- From: "Thomas Good" To: "Postgres SQL List" Sent: Tuesday, March 25, 2003 3:28 PM Subject: [SQL] Concatenation Snafu SELECT code || ' ' || diag, code FROM dsm4 WHERE axis =3D 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: tomg@sqlclinic.net 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=FCr 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 majordomo@postgresql.org)