Re: copy csv eclosed by analog quotes problem superuser ?

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Eugene <evgenius(at)hot(dot)ee>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: copy csv eclosed by analog quotes problem superuser ?
Date: 2005-12-27 17:34:34
Message-ID: 200512271734.jBRHYYq05042@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Eugene wrote:
> hello!
> I have IP CSV, it is huge CSV with quotes
> "69110784","69111807","US","UNITED
> STATES","ILLINOIS","BLOOMINGTON","40.4758","-88.9894","61701","LEVEL 3
> COMMUNICATIONS INC","DSL-VERIZON.NET"
> "69111808","69112831","US","UNITED
> STATES","TEXAS","GRAPEVINE","32.9309","-97.0755","76051","LEVEL 3
> COMMUNICATIONS INC","DSL-VERIZON.NET"
>
> In my sql there is enclosed by command, i can do this way
> mysql> LOAD DATA INFILE
> "<path>/IP-COUNTRY-REGION-CITY-LAT-LONG-ZIPCODE-ISP-DOMAIN.CSV" INTO TABLE
> IPCITYLATLONGISPDOMAIN FIELDS TERMINATED BY ',' ENCLOSED BY '"' LINES
> TERMINATED BY '\r\n';
>
> ENCLOSED BY '"' helps in mysql
>
>
> 1.in postgresql I can't do COPY WITH CSV, it says superuser needed

Right.

> 2. i can use is [\copy] but it wont help me, I get syntax error
> 3. i can't convert current csv into csv without quotes
>
> it is like a death circle ...

Please post the line that is generating the error, and the table schema,
the COPY syntax used, and the actual error message. Have you read the
COPY manual page?

--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Ted Byers 2005-12-27 17:41:44 Problem creating stored procedure
Previous Message George Pavlov 2005-12-27 16:26:37 Re: copy csv eclosed by analog quotes problem superuser ?