COPY command error in psql. 
Author Message
 COPY command error in psql.

Hi,

I'm trying to import tables in psql but am getting a permission denied
error. I'm using the '\i file' command as I intend to import 100+ tables
and want to set this up to run overnight (almost 1 GB of data is going in).

My test for this is not working. I have a 'batch' file the contents of
which are (at the moment) only:

COPY ab FROM '/home/ms/db/csv/AB.csv'

Table 'ab' exists as does the csv file and I am logged in as 'postgres'.

I am getting this error when I run "\i batchfile":

psql:batchfile:1: Error: Copy command, running in backend with effective
uid 26, could not open file '/home/ms/db/csv/AB.csv' for reading. Errorno =
permission denied (13).

Now I understand why this happened the first time I ran the command as only
user 'ms' had any kind of permission for AB.csv. But the same error
happened after I changed permissions to allow read, write and execute
access for user, group and others. Finally I changed AS.csv's ownership and
group to user 'postgres' and got the same error.

Anyone know how to resolve this?

Thanks,

Matthew

PS. I don't want to use '\copy' as I can't use this with a batch file to
import lots of tables.

---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?

http://www.***.com/



Sat, 25 Sep 2004 21:42:35 GMT
 
 [ 1 post ] 

 Relevant Pages 

1. pgsql/src backend/commands/copy.c bin/psql/copy.c

2. pgsql/src/bin/psql command.c copy.c describe.c

3. copy command with PSQL

4. copy command with PSQL

5. psql:relocation error:psql:unfefined symbol: PQgetssl

6. psql: relocation error: psql: undefined symbol: PQgetssl

7. pgsql/src/backend/commands (explain.c command.c copy.c)

8. Error in COPY STRUCTURE command

9. Copy Command Doesnt Copy Data

10. Unknown exception error on copy command

11. pgsql/src/bin/psql (copy.c)

12. pgsql-server/ oc/TODO rc/bin/psql/command.c


 
Powered by phpBB® Forum Software