Re: Carraige Return issues - Mailing list pgsql-general

From Oliver Elphick
Subject Re: Carraige Return issues
Date
Msg-id 1025862495.31483.4.camel@linda
Whole thread Raw
In response to Carraige Return issues  ("caroline kenny" <caroline_kenny@hotmail.com>)
List 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




pgsql-general by date:

Previous
From: Curt Sampson
Date:
Subject: Re: I am being interviewed by OReilly
Next
From: nholtz@docuweb.ca (Neal Holtz)
Date:
Subject: Re: EVAL and SET equivalents in PostgreSQL