Forum OpenACS Q&A: Using copy from psql

Collapse
Posted by Jim Noel on
Hi all,

I am trying to copy a file into our postgreS database.

I keep getting an error saying the file I am trying to load does not have permissions even though it does.

Here is my command line:
sqlfile=/home/oper/sacsma.sql

inside sacsma.sql
COPY sacsmastate from '/home/oper/sacsmastate.sql'
USING DELIMITERS '|' WITH NULL AS '\null';

/usr/bin/psql -At -h dell3-tir -d hd_ob6tir -U postgres -f $sqlfile

Any ideas why it is having trouble reading the sacsmastate.sql file?

-Jim

Collapse
2: Re: Using copy from psql (response to 1)
Posted by Tak-Hung Yu on
Does the database server process has read permission on /home/oper/sacsmastate.sql? (User postgres if you follow the installation documentation). Read the Notes section of the COPY documentation for more detail. http://www.postgresql.org/docs/8.0/interactive/sql-copy.html