From: | gabrielle <gorthx(at)gmail(dot)com> |
---|---|
To: | Rich Shepard <rshepard(at)appl-ecosys(dot)com> |
Cc: | pdxpug(at)postgresql(dot)org |
Subject: | Re: COPY command syntax error |
Date: | 2011-02-02 19:31:07 |
Message-ID: | AANLkTik2o89K4AbwcA5MZfACJjnbavC_SJhm3kEXWww2@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pdxpug |
On Wed, Feb 2, 2011 at 11:19 AM, Rich Shepard <rshepard(at)appl-ecosys(dot)com> wrote:
> I'm trying to import data from a .csv file into an existing table. It
> worked the first time I loaded data into this table.
>
> I'm invoking psql from the same directory as the import.csv file. The
> command I'm using,
> and the results are:
>
> jerrittwq=# copy monitor from
> '/home/rshepard/projects/queenstake/permitwatch/water-quality-info/csv_versions/import.csv'
> with delimiter as ':' csv;
> ERROR: could not open file
> "/home/rshepard/projects/queenstake/permitwatch/water-quality-info/csv_versions/import.csv"
> for reading: No such file or directory
>
> Doesn't matter how I specify the file's location (full path or cwd). Do I
> also need to specify the text delimeters with quote as '''? (The command
> line does not like my using double quotes to delimit the single quote.)
>
> What do I have syntactically wrong here?
That syntax (COPY table FROM '/path/to/file' WITH DELIMITER AS ':'
CSV;) works for me in a similar test.
Are you sure the file exists? Try taking off the "with ... csv" piece
and see if you get the same error.
gabrielle
From | Date | Subject | |
---|---|---|---|
Next Message | Rich Shepard | 2011-02-02 19:31:41 | Re: COPY command syntax error |
Previous Message | Rich Shepard | 2011-02-02 19:28:11 | Re: COPY command syntax error |