Re: Problem with Select output - Mailing list pgsql-general

From Alvaro Herrera
Subject Re: Problem with Select output
Date
Msg-id 20041222160647.GA6944@dcc.uchile.cl
Whole thread Raw
In response to Re: Problem with Select output  (srini vasan <srinibalaji_82@yahoo.com>)
List pgsql-general
On Wed, Dec 22, 2004 at 07:50:56AM -0800, srini vasan wrote:

Hi,

>    Can anybody please help me in this?

You could use the replace(text,text,text) function:

alvherre=# create table foo (a text);
CREATE TABLE
alvherre=# insert into foo values ('hola
alvherre'# ');
INSERT 155224 1
alvherre=# select * from foo;
   a
-------
 hola

(1 fila)

alvherre=# select replace(a, '\n', '\\n') from foo;
 replace
---------
 hola\n
(1 fila)

--
Alvaro Herrera (<alvherre[@]dcc.uchile.cl>)
"Para tener más hay que desear menos"

pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: 8.0 Beta3 worked, RC1 didn't!
Next
From: Fernando Schapachnik
Date:
Subject: Re: Problem with Select output