Re: String Concatenation - Mailing list pgsql-novice

From John Brookes
Subject Re: String Concatenation
Date
Msg-id 007d01c470d5$13f7ac00$6501a8c0@sccorp.com
Whole thread Raw
In response to String Concatenation  ("Luiz K. Matsumura" <luiz@planit.com.br>)
List pgsql-novice
 
----- Original Message -----
Sent: Friday, July 23, 2004 9:00 AM
Subject: [NOVICE] String Concatenation

I want to concatenate 2 fields :
tpmov char(4)  | dsmov char(10)
---------------+----------------
AB             | SOMETHING
 
If I do:
 
SELECT tpmov || dsmov as History ...
 
if the field tpmov has a fixed lenght of char(4) the result
expected (I suppose) may be
 
History
--------------
AB  SOMETHING
 
But Postgres returns
 
History
------------
ABSOMETHING
 
Why this occurs ?
How I can get the first result ( AB__SOMETHING ) ?
 
If I do a select with the literal strings the result is as expected :
 
SELECT 'AB  ' || 'SOMETHING' AS History ;
 
History
--------------
AB  SOMETHING
 
My reasoning is wrong or this is a bug ?
 
 

pgsql-novice by date:

Previous
From: "John Brookes"
Date:
Subject: Re: unique ID
Next
From: "bcscomputers"
Date:
Subject: