Re: Need help with COPY

From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: Jonathan Hseu <vomjom(at)vomjom(dot)org>
Cc: <pgsql-general(at)postgresql(dot)org>
Subject: Re: Need help with COPY
Date: 2001-06-16 12:46:26
Message-ID: Pine.LNX.4.30.0106161445340.755-100000@peter.localdomain
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Jonathan Hseu writes:

> I want to import a table from a file. The format of the table in the file is as
> such:
> "FName","LName","Address","City"
>
> The format of the table is:
> (FName varchar(80), LName varchar(80), Address varchar(80), City varchar(80))
>
> I want to do a:
> COPY table FROM 'filename' USING DELIMITERS ','
>
> The problem is, it also imports the quotes. Also, there are sometimes commas in
> the address, and it takes those as delimiters. Is there any way to make it take
> only the stuff within the quotes and ignore any delimiters within them?

You need to reformat your input files (strip quotes and use different
delimiter) or not use the COPY command.

--
Peter Eisentraut peter_e(at)gmx(dot)net http://funkturm.homeip.net/~peter

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Peter Eisentraut 2001-06-16 12:49:41 Re: NULL feilds and ERROR messages from libpq++
Previous Message Peter Eisentraut 2001-06-16 12:45:14 Re: ODBC, ssl, problems with.