Re: Using COPY command when input file contain backslashes?

From: Richard Huxton <dev(at)archonet(dot)com>
To: celia(dot)mcinnis(at)gmail(dot)com
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Using COPY command when input file contain backslashes?
Date: 2005-09-13 19:38:46
Message-ID: 43272AC6.20006@archonet.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Celia McInnis wrote:
> I'm wanting to use the COPY command to bulk-load data which may contain
> backslashes and other special characters, and I want these characters to
> remain intact. Right now "\\" becomes "\", and single backslashes are lost
> (or modify the meaning of the following character). Is there some way (apart
> from pre-processing my (huge) input files) to get the data correctly into
> postgres?

No - pre-process the files. Unless a Turing-complete pre-processor was
built in to PG, then this will always be necessary for some type of file.

Of course, you don't need to take up twice the space to do this - just
copy from STDIN and pipe the output to psql.

--
Richard Huxton
Archonet Ltd

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Craig 2005-09-13 20:07:45 Ranking Results
Previous Message Ben 2005-09-13 19:38:41 Re: full outer join performance