Re: Double newline bug with DBD::Pg: Where best to fix? - Mailing list pgsql-interfaces

From Tom Lane
Subject Re: Double newline bug with DBD::Pg: Where best to fix?
Date
Msg-id 9388.983305623@sss.pgh.pa.us
Whole thread Raw
In response to Re: Double newline bug with DBD::Pg: Where best to fix?  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Double newline bug with DBD::Pg: Where best to fix?  (Dan Lyke <danlyke@flutterby.com>)
Re: Double newline bug with DBD::Pg: Where best to fix?  (Peter Eisentraut <peter_e@gmx.net>)
List pgsql-interfaces
>> test=# insert into xyz(stuff) values('a string with 
>> test'# 
>> test'#  a two line break');
>> test=# select stuff from xyz;
>>                stuff               
>> ----------------------------------
>>  a string with 
>>  a two line break
>> (1 row)

>> (As you can see there are also some interesting issues with leading
>> spaces going on here).

On closer look, there is no leading-space issue.  Psql is formatting the
column with a leading space as it usually does, and the newline-space
in the string is just being echoed.  Compare:

regression=# select 'a string without a newline';         ?column?
----------------------------a string without a newline
(1 row)

regression=# select 'a string\nwith a newline';       ?column?
-------------------------a string
with a newline
(1 row)

regression=# select 'a string\n with a newline';        ?column?
--------------------------a stringwith a newline
(1 row)

regression=# select 'a string
regression'# with a newline';       ?column?
-------------------------a string
with a newline
(1 row)

regression=# select 'a string
regression'#  with a newline';        ?column?
--------------------------a stringwith a newline
(1 row)

That's all fine IMHO.  But this isn't:

regression=# select 'a string
regression'#
regression'# with a newline';       ?column?
-------------------------a string
with a newline
(1 row)
        regards, tom lane


pgsql-interfaces by date:

Previous
From: Tom Lane
Date:
Subject: Re: Double newline bug with DBD::Pg: Where best to fix?
Next
From: ivan
Date:
Subject: Re: Double newline bug with DBD::Pg: Where best to fix?