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

From: Michael Fuhr <mike(at)fuhr(dot)org>
To: Greg Stark <gsstark(at)mit(dot)edu>
Cc: Douglas McNaught <doug(at)mcnaught(dot)org>, emilu(at)cs(dot)concordia(dot)ca, pgsql-general(at)postgresql(dot)org
Subject: Re: About "ERROR: must be *superuser* to COPY to or from a file"
Date: 2005-08-26 22:59:41
Message-ID: 20050826225941.GA19407@winnie.fuhr.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Fri, Aug 26, 2005 at 06:04:52PM -0400, Greg Stark wrote:
> Douglas McNaught <doug(at)mcnaught(dot)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.

This doesn't address the general problem, but a COPY inside a
SECURITY DEFINER function might work in certain cases. You'd still
have security issues to deal with, like the location of the input
or output file and making sure that SESSION_USER has appropriate
permissons on the table being copied to or from.

--
Michael Fuhr

In response to

Browse pgsql-general by date

  From Date Subject
Next Message William Yu 2005-08-26 23:07:00 Re: Postgresql replication
Previous Message Matt A. 2005-08-26 22:59:31 Re: Altering functions cast