Re: About "ERROR: must be *superuser* to COPY to or from a file" - Mailing list pgsql-general

From Greg Stark
Subject Re: About "ERROR: must be *superuser* to COPY to or from a file"
Date
Msg-id 87y86o8id7.fsf@stark.xeocode.com
Whole thread Raw
In response to Re: About "ERROR: must be *superuser* to COPY to or from a file"  (Douglas McNaught <doug@mcnaught.org>)
Responses Re: About "ERROR: must be *superuser* to COPY to or from a file"  (Douglas McNaught <doug@mcnaught.org>)
Re: About "ERROR: must be *superuser* to COPY to or from a file"  (Michael Fuhr <mike@fuhr.org>)
List pgsql-general
Douglas McNaught <doug@mcnaught.org> writes:

> You can use \copy in 'psql' on the client side, but you have to be a
> superuser to do COPY on the server side, for security reasons.

I wonder if there's any way to relax this constraint.

If you're connected via a unix domain socket we can know the UID of the client
end. I don't see reproducing the entire unix semantics but if file is owned by
the same uid as the user connecting it seems like it ought to be safe.

--
greg

pgsql-general by date:

Previous
From: "Matt A."
Date:
Subject: Altering functions cast
Next
From: Douglas McNaught
Date:
Subject: Re: About "ERROR: must be *superuser* to COPY to or from a file"