copy commands and linefeeds - Mailing list pgsql-novice

From Mija Lee
Subject copy commands and linefeeds
Date
Msg-id 200709182349.l8INnCka027661@brood2.pc.scharp.org
Whole thread Raw
Responses Re: copy commands and linefeeds  (Oliver Elphick <olly@lfix.co.uk>)
List pgsql-novice
Hi -

I have two questions that have arisen as a result of using the copy command to
create csv files.

1. Apparently, the table from which I am trying to create the csv file has
linefeeds/carriage returns in it that don't belong there. UGH! Is there a way to
restrict the users from inserting linefeeds into the field? They are connecting
via odbc from some windows app (probably access) so I assume it's a windows
linefeed, and although I can't see them, I know they are there because the
output has them, and I get the following warning:

WARNING:  CSV fields with embedded linefeed or carriage return characters might
not be able to be reimported


2. I'm not sure I understand the copy sytax. If I want text to be in single
quotes instead of double quotes, the way I read the doc, the following should
work:

copy table1 to 'output.txt' with csv quote as ''';

which doesn't seem to work. Am I misreading the doc?

Thanks in advance for any help!

Mija


pgsql-novice by date:

Previous
From: "A. Kretschmer"
Date:
Subject: Re: [GENERAL] ON INSERT => execute AWK/SH/EXE?
Next
From: "Sandeep Agarwal"
Date:
Subject: Null records in pg_operator