Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1h3l2s-00006d-7H for pgsql-bugs@arkaria.postgresql.org; Tue, 12 Mar 2019 17:18:30 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1h3l2q-0006ZM-UW for pgsql-bugs@arkaria.postgresql.org; Tue, 12 Mar 2019 17:18:28 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1h3l2q-0006ZE-OG for pgsql-bugs@lists.postgresql.org; Tue, 12 Mar 2019 17:18:28 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1h3l2o-0003aH-Os for pgsql-bugs@lists.postgresql.org; Tue, 12 Mar 2019 17:18:28 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id x2CHIO3i009348; Tue, 12 Mar 2019 13:18:24 -0400 From: Tom Lane To: Jon Wedell cc: pgsql-bugs@lists.postgresql.org, Dimitri Maziuk Subject: Re: Bug involving plus sign before newline in text field being duplicated or stripped In-reply-to: <7ccaa770-ef82-42bf-dd56-dc595728d0d6@bmrb.wisc.edu> References: <7ccaa770-ef82-42bf-dd56-dc595728d0d6@bmrb.wisc.edu> Comments: In-reply-to Jon Wedell message dated "Tue, 12 Mar 2019 10:36:45 -0500" MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-ID: <9346.1552411104.1@sss.pgh.pa.us> Content-Transfer-Encoding: 8bit Date: Tue, 12 Mar 2019 13:18:24 -0400 Message-ID: <9347.1552411104@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Jon Wedell 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