Re: Carraige Return issues

Lists: pgsql-general
From: "caroline kenny" <caroline_kenny(at)hotmail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Carraige Return issues
Date: 2002-07-04 15:15:02
Message-ID: F218EMB05lKdRZBMdSU0000834b@hotmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general

Users!
I hope that someone outthere can help me. I am trying to insert the text
from a file into a database. The file contains 2 carraige returns in it.
When i go to retrieve this this information from the specific field in the
database, the carraige return seems to have disappeared and the lines just
read one after the other...does anyone know how i can overcome this problem
Thanks
Caroline

_________________________________________________________________
MSN Photos is the easiest way to share and print your photos:
http://photos.msn.com/support/worldwide.aspx


From: Oliver Elphick <olly(at)lfix(dot)co(dot)uk>
To: caroline kenny <caroline_kenny(at)hotmail(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Carraige Return issues
Date: 2002-07-05 09:48:15
Message-ID: 1025862495.31483.4.camel@linda
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general

On Thu, 2002-07-04 at 16:15, caroline kenny wrote:

> I hope that someone outthere can help me. I am trying to insert the text
> from a file into a database. The file contains 2 carraige returns in it.
> When i go to retrieve this this information from the specific field in the
> database, the carraige return seems to have disappeared and the lines just
> read one after the other...does anyone know how i can overcome this problem

You need to escape the newline characters.

Here's an example of copying multiline text from a file

junk-# \! cat /tmp/ol
1 line 1 of text\
\
\
line4 of text
\.

junk=# copy tt from '/tmp/ol';
COPY
junk=# select * from tt;
id | t
----+--------------------------------
1 | line 1 of text


line4 of text
(1 row)

Oliver Elphick