String Concatenation - Mailing list pgsql-novice

From Luiz K. Matsumura
Subject String Concatenation
Date
Msg-id 002301c470ce$2f15d3b0$1600a8c0@NOTELUIZ
Whole thread Raw
Responses Re: String Concatenation
List pgsql-novice
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: Bruno Wolff III
Date:
Subject: Re: unique ID
Next
From: Betsy Barker
Date:
Subject: ERROR: pg_class_aclcheck: relation (OID) not found with SELECT INTO variable