Stupid question: concatenating strings - Mailing list pgsql-novice

From Justin Long
Subject Stupid question: concatenating strings
Date
Msg-id PBEMJIMKFNACLPCNPDEBGEGNDPAA.justinlong@strategicnetwork.org
Whole thread Raw
In response to Re[2]: SETOF modifier  (Jean-Christophe Boggio <cat@thefreecat.org>)
Responses Re: Stupid question: concatenating strings  (<bmccoy@chapelperilous.net>)
Re: Stupid question: concatenating strings  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-novice
I can't figure out how to do this.

I want to do the following

UPDATE newlink SET newfrom = substr(oldfrom,0,1) + '-' + substr(oldfrom,1)

... I want to do this:

take the following variables

CAFG
CBTN
CNPL
CUSA

and transform it to this:

C-AFG
C-BTN
C-NPL
C-USA

Someone please help me! I've been through the user manual & I can't find out
how to do it. Pgsql just tells me:

Unable to identify an operator '+' for types 'text' and 'unknown'
You will have to retype this query using an explicit cast


_________________________________________________________________
Justin Long                Network for Strategic Missions
1732 South Park Court        Never retreat. Never surrender.
Chesapeake, VA 23320, USA    Never cut a deal with a dragon.
757-213-2055, ICQ 83384482    http://www.strategicnetwork.org
Monday Morning Reality Check:    reality-check-subscribe@egroups.com


pgsql-novice by date:

Previous
From: Gerhard Kroder
Date:
Subject: test ok, but...
Next
From:
Date:
Subject: Re: Stupid question: concatenating strings