copy command permissions problem. only \copy works why

copy command permissions problem. only \copy works why

Post by Mitchell La » Sat, 28 Sep 2002 10:28:31



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

 
 
 

copy command permissions problem. only \copy works why

Post by jake johns » Sat, 05 Oct 2002 21:40:24


Quote:> 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!

[ snip ]

I just started using this Mandrake system and I'm having this problem
too!  My other systems didn't have this problem (debian, freebsd,
etc.).  Seems to be more than a file permissions error - unfortunately
your (our) question didn't merit any answers.