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

From Douglas McNaught
Subject Re: About "ERROR: must be *superuser* to COPY to or from a file"
Date
Msg-id m2pss0o1pg.fsf@Douglas-McNaughts-Powerbook.local
Whole thread Raw
In response to About "ERROR: must be *superuser* to COPY to or from a file"  (Emi Lu <emilu@cs.concordia.ca>)
Responses Re: About "ERROR: must be *superuser* to COPY to or from a file"  (Greg Stark <gsstark@mit.edu>)
List pgsql-general
Emi Lu <emilu@cs.concordia.ca> writes:

> Greetings,
>
> I met a question about Copy. I tried to run :
>    copy test(studid) from '/myownDIR/a.txt';
>
> But I got an error as the following:
> ERROR:  must be *superuser* to COPY to or from a file
>
> May I know is it possible that instead of supervuser, regular users
> are able to use COPY as well?

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.

If you are not using 'psql' and your client library supports it, you
can use 'COPY FROM stdin' and pass the data across the client
connection.

-Doug

pgsql-general by date:

Previous
From: vishal saberwal
Date:
Subject: Re: PQConnectdb SSL (sslmode): Is this a bug
Next
From: vishal saberwal
Date:
Subject: Re: PQConnectdb SSL (sslmode): Is this a bug