I am running Redhat Linux 7.3 and postgresql 7.2.1-5 and
I am trying to learn improve my postgres skills.
I tried to populate a table appliationentity with data from a file
called
/home/wustl/testapp/applicationentity
The user wustl, is a valid creater of the CTNControl database:
my interaction:::
CTNControl=# copy applicationentity from
'/home/wustl/testapp/applicationentity';
ERROR: COPY command, running in backend with effective uid 26, could
not open
file '/home/wustl/testapp/applicationentity' for reading. Errno =
Permission
denied (13).
CTNControl=# \q
so i tried to chown the file so to make postgres happy!
chown: changing ownership of `applicationentity': Operation not
permitted
(here 26 is the userid and gid of postgres account)
so i do it the other way
Welcome to psql, the PostgreSQL interactive terminal.
Type: \copyright for distribution terms
\h for help with SQL commands
\? for help on internal slash commands
\g or terminate with semicolon to execute query
\q to quit
CTNControl=# \copy applicationentity from
'/home/wustl/testapp/applicationentity'
this works. so what to do to use the copy command rather than the
\copyfrom
postgres???
note it also did not work when i first did chmod 744 /home/wustl to
make the directory readable to all users.
thanks