Re: ERROR: must be superuser to COPY to or from a file - Mailing list pgsql-novice

From Sean Davis
Subject Re: ERROR: must be superuser to COPY to or from a file
Date
Msg-id 46FD5CCB.50708@mail.nih.gov
Whole thread Raw
In response to ERROR: must be superuser to COPY to or from a file  ("Jorge Alberto" <csnmgeek@gmail.com>)
Responses Re: ERROR: must be superuser to COPY to or from a file  ("Jorge Alberto" <csnmgeek@gmail.com>)
List pgsql-novice
Jorge Alberto wrote:
> Hello
> I want to fill in a table from a file, but when I use the COPY command I
> get the following error:
>
> mydb=> COPY weather FROM '/home/fideito/weather.txt';
> ERROR:  must be superuser to COPY to or from a file
> HINT:  Anyone can COPY to stdout or from stdin. psql's \copy command
> also works for anyone.
>
> But, what can I do if I'm not root?

Use \copy (as the error message suggests) rather than copy.  That should
do it.

Sean

pgsql-novice by date:

Previous
From: "Jorge Alberto"
Date:
Subject: ERROR: must be superuser to COPY to or from a file
Next
From: Kamchybek Jusupov
Date:
Subject: Re: ERROR: must be superuser to COPY to or from a file