From: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
---|---|
To: | Dan Lyke <danlyke(at)flutterby(dot)com>, pgsql-interfaces(at)postgresql(dot)org, Peter Eisentraut <peter_e(at)gmx(dot)net> |
Subject: | Re: Double newline bug with DBD::Pg: Where best to fix? |
Date: | 2001-02-27 20:27:03 |
Message-ID: | 9388.983305623@sss.pgh.pa.us |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | 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 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
From | Date | Subject | |
---|---|---|---|
Next Message | Dan Lyke | 2001-02-27 20:39:47 | Re: Double newline bug with DBD::Pg: Where best to fix? |
Previous Message | Tom Lane | 2001-02-27 20:21:58 | Re: Double newline bug with DBD::Pg: Where best to fix? |