Re: Bug involving plus sign before newline in text field being duplicated or stripped - Mailing list pgsql-bugs

From Tom Lane
Subject Re: Bug involving plus sign before newline in text field being duplicated or stripped
Date
Msg-id 9347.1552411104@sss.pgh.pa.us
Whole thread Raw
In response to Bug involving plus sign before newline in text field being duplicatedor stripped  (Jon Wedell <wedell@bmrb.wisc.edu>)
List pgsql-bugs
Jon Wedell <wedell@bmrb.wisc.edu> writes:
> postgres=# create table test (inchi text);
> CREATE TABLE
> postgres=# insert into test values ('test+
> postgres'# ');
> INSERT 0 1
> postgres=# select * from test;
>  inchi
> -------
>  test++
>  
> (1 row)

Well, that one is not a bug.  The character value you inserted is
"t e s t + newline", and when psql renders a value including a
newline, by default it puts a plus at the end of the preceding line.
You can alter that behavior with psql's various \pset options, I believe.

> The second bug is that pyscopg2-binary is stripping a plus sign at the
> end of the value out.

I don't use pyscopg2, but I suspect that you're confusing
the decorative "+" shown by psql with actual data.

            regards, tom lane


pgsql-bugs by date:

Previous
From: Alvaro Herrera
Date:
Subject: Re: Bug involving plus sign before newline in text field beingduplicated or stripped
Next
From: Jon Wedell
Date:
Subject: Re: Bug involving plus sign before newline in text field beingduplicated or stripped