From: Tom Lane <tgl@sss.pgh.pa.us>
To: Jon Wedell <wedell@bmrb.wisc.edu>
Cc: pgsql-bugs@lists.postgresql.org, Dimitri Maziuk <dmaziuk@bmrb.wisc.edu>
Subject: Re: Bug involving plus sign before newline in text field being duplicated or stripped
Date: Tue, 12 Mar 2019 13:18:24 -0400
Message-ID: <9347.1552411104@sss.pgh.pa.us> (raw)
In-Reply-To: <7ccaa770-ef82-42bf-dd56-dc595728d0d6@bmrb.wisc.edu>
References: <7ccaa770-ef82-42bf-dd56-dc595728d0d6@bmrb.wisc.edu>
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-bugs@postgresql.org
Cc: tgl@sss.pgh.pa.us, wedell@bmrb.wisc.edu, dmaziuk@bmrb.wisc.edu
Subject: Re: Bug involving plus sign before newline in text field being duplicated or stripped
In-Reply-To: <9347.1552411104@sss.pgh.pa.us>
References: <7ccaa770-ef82-42bf-dd56-dc595728d0d6@bmrb.wisc.edu> <9347.1552411104@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox