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

From Kamchybek Jusupov
Subject Re: ERROR: must be superuser to COPY to or from a file
Date
Msg-id A50E9AA0-F494-4BA4-87FB-9A82A8C6BEA1@gmail.com
Whole thread Raw
In response to ERROR: must be superuser to COPY to or from a file  ("Jorge Alberto" <csnmgeek@gmail.com>)
List pgsql-novice
there is more than a way to skin a cat...


CREATE TABLE table1 (
   code char(5),
   name char(10)
);

synack@deimos db $ cat /tmp/tt.txt
1,kamchi
2,mahabat
3,kamila

postgres@deimos ~ $ cat /tmp/tt.txt | psql -h localhost -d tt -c "copy
table1 from stdin delimiter ',';"

postgres@deimos ~ $ psql -d tt -c "select * from table1;"
  code  |    name
-------+------------
  1     | kamchi
  2     | mahabat
  3     | kamila
(3 rows)


Rgds,

Kamchybek Jusupov
kjusupov@gmail.com



On Sep 29, 07, at 3:40 AM, 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?
>
>
>


pgsql-novice by date:

Previous
From: Sean Davis
Date:
Subject: Re: ERROR: must be superuser to COPY to or from a file
Next
From: Richard Broersma Jr
Date:
Subject: Re: Why is my view ddl being altered by postgres?