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

Поиск
Список
Период
Сортировка
От Jorge Alberto
Тема Re: ERROR: must be superuser to COPY to or from a file
Дата
Msg-id 67a412e40709281309t3d522e85y4570a5b7f7008eaf@mail.gmail.com
обсуждение исходный текст
Ответ на Re: ERROR: must be superuser to COPY to or from a file  (Sean Davis <sdavis2@mail.nih.gov>)
Ответы Re: ERROR: must be superuser to COPY to or from a file  (Richard Broersma Jr <rabroersma@yahoo.com>)
Список pgsql-novice
thanks for your answer:
the command \copy works but the syntax is different

error:
mydb=> \copy weather FROM "/home/fideito/weather.txt";
"/home/fideito/weather.txt";: No such file or directory

error:
mydb=> \copy weather FROM "/home/fideito/weather.txt"
"/home/fideito/weather.txt": No such file or directory

correct syntax:
mydb=> \copy weather FROM /home/fideito/weather.txt

I have to delete the "" and the ";" to make it work.
Do you know why is that?

On 9/28/07, Sean Davis < sdavis2@mail.nih.gov> wrote:
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 по дате отправления:

Предыдущее
От: Richard Broersma Jr
Дата:
Сообщение: Re: Why is my view ddl being altered by postgres?
Следующее
От: Richard Broersma Jr
Дата:
Сообщение: Re: ERROR: must be superuser to COPY to or from a file