Re: Strange Result with char concatenation in query.

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "mathieu(dot)chappuis(at)msg-software(dot)com" <mathieu(dot)chappuis(at)msg-software(dot)com>
Cc: "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Re: Strange Result with char concatenation in query.
Date: 2002-05-27 21:21:00
Message-ID: 27465.1022534460@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

"mathieu(dot)chappuis(at)msg-software(dot)com" <mathieu(dot)chappuis(at)msg-software(dot)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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Manfred Koizar 2002-05-27 21:47:46 Re: Strange Result with char concatenation in query.
Previous Message Devrim GUNDUZ 2002-05-27 21:10:04 Re: RPM for latest version of Postgres