Thread: Data In Tables Sometimes Have +

Data In Tables Sometimes Have +

From
Carlos Mennens
Date:
I've noticed as I interact with my database I use for customers, there
are from time to time values that have a strange '+' character. For
example:

forge=# SELECT cust_id, cust_name, cust_contact, cust_email
FROM customers
WHERE cust_name Like 'Truth%';
  cust_id   |     cust_name      | cust_contact  |     cust_email
------------+--------------------+---------------+---------------------
 1020105577 | Truth Custom Drums | Geoff Barrios | info@truthdrums.com+
            |                    |               |
(1 row)

You can see the field called 'cust_email' shows a trailing '+' for
some odd reason. Generally I would chalk this up to fat fingering data
or something but I have seen it on more than a few occasions and
really don't know what it means or why it's there. I know if I use the
'UPDATE' statement and change the address, it goes away:

forge=# UPDATE customers
forge-# SET cust_email = 'info@truthdrums.com'
forge-# WHERE cust_id = '1020105577';
UPDATE 1

Now the '+' is obviously gone...

forge=# SELECT cust_id, cust_name, cust_contact, cust_email
FROM customers
WHERE cust_name Like 'Truth%';
  cust_id   |     cust_name      | cust_contact  |     cust_email
------------+--------------------+---------------+---------------------
 1000000007 | Truth Custom Drums | Geoff Barrios | info@truthdrums.com
(1 row)

Re: Data In Tables Sometimes Have +

From
Tom Lane
Date:
Carlos Mennens <carlos.mennens@gmail.com> writes:
> I've noticed as I interact with my database I use for customers, there
> are from time to time values that have a strange '+' character. For
> example:

> forge=# SELECT cust_id, cust_name, cust_contact, cust_email
> FROM customers
> WHERE cust_name Like 'Truth%';
>   cust_id   |     cust_name      | cust_contact  |     cust_email
> ------------+--------------------+---------------+---------------------
>  1020105577 | Truth Custom Drums | Geoff Barrios | info@truthdrums.com+
>             |                    |               |
> (1 row)

That's a line-break marker.  Looks like you have embedded or trailing
newlines in some of your field values.

            regards, tom lane

Re: Data In Tables Sometimes Have +

From
Brent Dombrowski
Date:
On Mar 2, 2012, at 11:40 AM, Carlos Mennens wrote:
> I've noticed as I interact with my database I use for customers, there
> are from time to time values that have a strange '+' character. For
> example:
>
> forge=# SELECT cust_id, cust_name, cust_contact, cust_email
> FROM customers
> WHERE cust_name Like 'Truth%';
>  cust_id   |     cust_name      | cust_contact  |     cust_email

I noticed that when I upgraded from 8.2 to 9.0. The 9.0 client (psql) was adding those in. I don't remember now what
triggeredit, but they are not in the actual data. 

Brent.