Re: Problem with Select output

From: Alvaro Herrera <alvherre(at)dcc(dot)uchile(dot)cl>
To: srini vasan <srinibalaji_82(at)yahoo(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Problem with Select output
Date: 2004-12-22 16:06:47
Message-ID: 20041222160647.GA6944@dcc.uchile.cl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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[(at)]dcc(dot)uchile(dot)cl>)
"Para tener más hay que desear menos"

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Fernando Schapachnik 2004-12-22 16:12:32 Re: Problem with Select output
Previous Message Tom Lane 2004-12-22 16:05:52 Re: 8.0 Beta3 worked, RC1 didn't!