Home > Archive > PostgreSQL Discussion > August 2005 > Re: About "ERROR: must be *superuser* to COPY to or from a file"









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Re: About "ERROR: must be *superuser* to COPY to or from a file"
Doug Bloebaum

2005-08-31, 9:28 am

Jim Nasby asked:

What do people think about the Oracle method where bulk data operations
> can only occur in a specified directory? Making that restriction might
> address some of the security concerns. I don't think we should change
> COPY in such a way that you *have* to use a specified directory, but if
> it was an option that helped with the security concerns...



Oracle's new (well, since 9i) DIRECTORY object (see
http://download-west.oracle.com/doc....htm#sthref4678)
has proven itself to be a flexible approach for me.

A privileged account creates the DIRECTORY object like so:

CREATE OR REPLACE DIRECTORY my_dir AS '/var/tmp/my_dir';

and then grants access to it:

GRANT READ ON my_dir to db_username;

I'd envision the COPY command using the DIRECTORY object something like:

COPY my_table FROM my_dir:'file.txt';

Sponsored Links





Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive | Programming forum archive

Copyright 2008 droptable.com