From: | Jude DaShiell <jdashiel(at)panix(dot)com> |
---|---|
To: | Alonso Isidoro Roman <alonsoir(at)gmail(dot)com> |
Cc: | pgsql-novice(at)postgresql(dot)org |
Subject: | Re: newbee, about a bulk loading from a cdv file |
Date: | 2014-10-09 18:59:27 |
Message-ID: | alpine.NEB.2.00.1410091457520.9950@panix2.panix.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-novice |
Who owns fakedata.csv? If not you, that could be your problem. As root,
try chown tom fakedata.csv then try again.
--
On Mon, 15 Sep 2014, Alonso Isidoro Roman wrote:
> hi, i am just trying to do a bulk data loading using this way and i am
> finding problems. I have just created an user in my system, tom/mypass, then
> i have just created the user and the database, then the tables:
>
> MacBook-Pro-Retina-de-Alonso:~ aironman$ psql template1
> psql (9.3.5)
> Type "help" for help.
>
> template1=# CREATE USER tom WITH PASSWORD 'mypass';
> CREATE ROLE
> template1=# CREATE DATABASE "TrialDB";
> CREATE DATABASE
> template1=# GRANT ALL PRIVILEGES ON DATABASE "TrialDB" to tom;
> GRANT
>
> TrialDB=> CREATE TABLE core2door_element
> TrialDB-> (
> TrialDB(> id serial NOT NULL,
> TrialDB(> key character varying(255) NOT NULL,
> TrialDB(> type character varying(255) NOT NULL,
> TrialDB(> label character varying(255) NOT NULL,
> TrialDB(> longitude double precision NOT NULL,
> TrialDB(> latitude double precision NOT NULL,
> TrialDB(> parent_id integer,
> TrialDB(> CONSTRAINT core2door_element_pkey PRIMARY KEY (id),
> TrialDB(> CONSTRAINT core2door_element_parent_id_fkey FOREIGN KEY
> (parent_id)
> TrialDB(> REFERENCES core2door_element (id) MATCH SIMPLE
> TrialDB(> ON UPDATE NO ACTION ON DELETE NO ACTION DEFERRABLE INITIALLY
> DEFERRED
> TrialDB(> )
> TrialDB-> WITH (
> TrialDB(> OIDS=FALSE
> TrialDB(> );
> CREATE TABLE
> TrialDB=> ALTER TABLE core2door_element OWNER TO tom;
> ALTER TABLE
>
> Now, if i try to launch COPY command:
>
> TrialDB=> COPY core2door(id,key,type,label,longitude,latitude,parent_id)
> FROM '/Users/aironman/Documents/tektroniks/fake_data_entity.csv' WITH
> DELIMITER ',' CSV HEADER;
> 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.
>
> COPY is not working, trying with \copy:
>
> TrialDB=> \copy core2door(id,key,type,label,longitude,latitude,parent_id)
> FROM '/Users/aironman/Documents/tektroniks/fake_data_entity.csv' WITH
> DELIMITER ',' CSV HEADER;
> /Users/aironman/Documents/tektroniks/fake_data_entity.csv: Permission denied
>
> permission denied too!
>
> As you can see, the cdv file have every permission:
>
> MacBook-Pro-Retina-de-Alonso:tektroniks aironman$ ls -l
> fake_data_entity.csv
> -rwxrwxrwx+ 1 aironman staff 351 sep 15 09:53 fake_data_entity.csv
>
> what do i am doing wrong?
>
> Regards!
>
> PS
>
> my apologies if this is a not a correct question, but i am desperate.
>
> Alonso Isidoro Roman.
>
> Mis citas preferidas (de hoy) :
> "Si depurar es el proceso de quitar los errores de software, entonces
> programar debe ser el proceso de introducirlos..."
> - Edsger Dijkstra
>
> My favorite quotes (today):
> "If debugging is the process of removing software bugs, then programming
> must be the process of putting ..."
> - Edsger Dijkstra
>
> "If you pay peanuts you get monkeys"
>
>
>
From | Date | Subject | |
---|---|---|---|
Next Message | Gary Warner | 2014-10-09 21:25:41 | Picking 25 samples of every domain |
Previous Message | Jude DaShiell | 2014-10-09 13:37:35 | report headers problem solved |