Re: Strange Result with char concatenation in query. - Mailing list pgsql-general

From Tom Lane
Subject Re: Strange Result with char concatenation in query.
Date
Msg-id 27465.1022534460@sss.pgh.pa.us
Whole thread Raw
In response to Strange Result with char concatenation in query.  ("mathieu.chappuis@msg-software.com" <mathieu.chappuis@msg-software.com>)
List pgsql-general
"mathieu.chappuis@msg-software.com" <mathieu.chappuis@msg-software.com> writes:
> test_db=> SELECT '+'||numtst||'+' AS "numtst", '*'||chartst||'-' AS "chartst"  FROM test;
>  numtst | chartst
> --------+------------
> -+2+    | *100/100
> -+4+    | *100/100
> -+5+    | *200/200
> (3 rows)

> As you see the last '-' in the second column is appended to the first column.

I think you have carriage returns in the values of chartst, which would
not be surprising if the original data file had Windows-style newlines
in it.  COPY expects Unix-style newlines.

            regards, tom lane

pgsql-general by date:

Previous
From: "Naveen Kaul"
Date:
Subject: Help needed.
Next
From: Manfred Koizar
Date:
Subject: Re: Strange Result with char concatenation in query.