Re: Identifying Reason for Column Name Returned by SELECT

From: Merlin Moncure <mmoncure(at)gmail(dot)com>
To: Rich Shepard <rshepard(at)appl-ecosys(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Identifying Reason for Column Name Returned by SELECT
Date: 2011-09-14 18:13:47
Message-ID: CAHyXU0yRKuHxrZY37axWyq+B-GyS5ZtxdGqEeQmW5k+9zhW1wA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Wed, Sep 14, 2011 at 12:04 PM, Rich Shepard <rshepard(at)appl-ecosys(dot)com> wrote:
> On Wed, 14 Sep 2011, Steve Crawford wrote:
>
>> I suspect you have a multi-line entry and the '+' is just indicating that
>> the field continues.
>
> Steve, et al.:
>
>  It's not multi-line, but malformed.

It *is* mult-line. psql uses a '+ to show line breaks:

postgres=# select E'a\nb';
?column?
----------
a +
b
(1 row)

To fix your data, i'd consider using the replace() function to knock
out newlines:
postgres=# select replace(E'a\nb', E'\n', '');
replace
---------
ab
(1 row)

Also consider adjusting the app and/or the database to block them in the future.

merlin

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Steve Crawford 2011-09-14 18:15:07 Re: Arrays
Previous Message Merlin Moncure 2011-09-14 18:09:27 Re: Arrays