pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Chad Thompson <chad@weblinkservices.com>
To: Thomas Good <tomg@sqlclinic.net>
To: Postgres SQL List <pgsql-sql@postgreSQL.org>
Subject: Re: Concatenation Snafu
Date: Tue, 25 Mar 2003 16:01:03 -0700
Message-ID: <049c01c2f322$69ee2e90$32021aac@chad> (raw)
References: <Pine.LNX.4.44.0303251726580.23371-100000@q8.nrnet.org>

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" <tomg@sqlclinic.net>
To: "Postgres SQL List" <pgsql-sql@postgreSQL.org>
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: 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ü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 majordomo@postgresql.org)




view thread (5+ messages)  latest in thread

Message-ID: <049c01c2f322$69ee2e90$32021aac@chad>
Permalink:  ../049c01c2f322$69ee2e90$32021aac@chad/
Also on:    postgresql.org/message-id/049c01c2f322$69ee2e90$32021aac@chad

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: chad@weblinkservices.com, tomg@sqlclinic.net
  Subject: Re: Concatenation Snafu
  In-Reply-To: <049c01c2f322$69ee2e90$32021aac@chad>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox