| From: | Ian Barwick <ian(at)2ndquadrant(dot)com> | 
|---|---|
| To: | Rich Shepard <rshepard(at)appl-ecosys(dot)com>, pgsql-general(at)postgresql(dot)org | 
| Subject: | Re: Appended '+' in Column Value | 
| Date: | 2014-08-22 21:57:43 | 
| Message-ID: | 53F7BCD7.2030506@2ndquadrant.com | 
| Views: | Whole Thread | Raw Message | Download mbox | Resend email | 
| Thread: | |
| Lists: | pgsql-general | 
On 14/08/23 6:46, Rich Shepard wrote:
>   One column in a table has values for the attribute 'stream'. Some queries
> return some rows where a stream name (only identified one so far) has an
> appended '+'. I cannot update the table to remove that appended character,
> and I've not seen this before.
> 
>   Example:
> 
>    2220 | STV     | 2012-07-12 | Nematoda |             |              |
>          |          | Omnivore      |    50 |          | StarvationCrk+| Owyhee
>         |         |            |          |             |              |
>          |          |               |       |          |               |
>    2701 | STV-10  | 2013-07-10 | Nematoda |             |              |
>          |          | Omnivore      |    36 |          | StarvationCrk | Owyhee
> 
>   I'd appreciate learning where that '+' originates and how to get rid of
> it. A query to count the rows with the appendage returns zero:
> 
> select count(*) from benthos where stream = 'StarvationCrk';
>  count -------
>    204
> 
> select count(*) from benthos where stream = 'StarvationCrk+';
>  count -------
>      0
You have a newline character. Try:
select count(*) from benthos where stream = E'StarvationCrk\n';
Regards
Ian Barwick
-- 
 Ian Barwick                   http://www.2ndQuadrant.com/
 PostgreSQL Development, 24x7 Support, Training & Services
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Adrian Klaver | 2014-08-22 21:58:29 | Re: Appended '+' in Column Value | 
| Previous Message | Karsten Hilbert | 2014-08-22 21:54:33 | Re: Appended '+' in Column Value |