pg.ddx.io  pgsql-interfaces@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Dan Lyke <danlyke@flutterby.com>
To: pgsql-interfaces@postgresql.org, Peter Eisentraut <peter_e@gmx.net>
Subject: Re: Double newline bug with DBD::Pg: Where best to fix?
Date: Tue, 27 Feb 2001 15:27:03 -0500
Message-ID: <9388.983305623@sss.pgh.pa.us> (raw)
In-Reply-To: <9351.983305318@sss.pgh.pa.us>
References: <15003.65308.557357.318833@wynand.flutterby.com>
	<9351.983305318@sss.pgh.pa.us>

>> 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 string
 with 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 string
 with 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



view thread (10+ messages)  latest in thread

Message-ID: <9388.983305623@sss.pgh.pa.us>
Permalink:  ../9388.983305623@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/9388.983305623@sss.pgh.pa.us

 · 

reply

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-interfaces@postgresql.org
  Cc: tgl@sss.pgh.pa.us, danlyke@flutterby.com, peter_e@gmx.net
  Subject: Re: Double newline bug with DBD::Pg: Where best to fix?
  In-Reply-To: <9388.983305623@sss.pgh.pa.us>
  References: <15003.65308.557357.318833@wynand.flutterby.com> <9351.983305318@sss.pgh.pa.us> <9388.983305623@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