Granting COPY FROM access

Started by Jim Cseralmost 20 years ago2 messagesgeneral
Jump to latest
#1Jim Cser
Cser@metro.dst.or.us

The problem isn't permission for copy, it permission to access files.

only the super user can access the file system through pgsql, because

of

security concerns.

copy can be run by anybody. copy from/to a FILE can only be done by

the

super user.

Have you tried queueing up copy from stdin and a stream of data and

\.

in ODBC? I'm pretty sure that'll work, but I've never tried it.

I imagine that your solution would work, but the larger issue is that I
am sending the SQL from an R program, and not using the psql console. I
could launch it the console programmatically and send copy commands to
it, but that's just adding more moving parts. Having everyone be a
superuser is good enough for now, thanks anyway.

-Jim Cser

#2Scott Marlowe
smarlowe@g2switchworks.com
In reply to: Jim Cser (#1)
Re: Granting COPY FROM access

On Thu, 2006-07-06 at 15:03, Jim Cser wrote:

The problem isn't permission for copy, it permission to access files.

only the super user can access the file system through pgsql, because

of

security concerns.

copy can be run by anybody. copy from/to a FILE can only be done by

the

super user.

Have you tried queueing up copy from stdin and a stream of data and

\.

in ODBC? I'm pretty sure that'll work, but I've never tried it.

I imagine that your solution would work, but the larger issue is that I
am sending the SQL from an R program, and not using the psql console. I
could launch it the console programmatically and send copy commands to
it, but that's just adding more moving parts. Having everyone be a
superuser is good enough for now, thanks anyway.

You don't need the psql console, that's what I've been trying to say.

I do this stuff routinely in php and other languages.

Note that if R is generating this data from postgresql to begin with,
you might be better off with pl/R