Re: newbee, about a bulk loading from a cdv file - Mailing list pgsql-novice

From Gerald Cheves
Subject Re: newbee, about a bulk loading from a cdv file
Date
Msg-id 5416D25A.7010201@verizon.net
Whole thread Raw
In response to newbee, about a bulk loading from a cdv file  (Alonso Isidoro Roman <alonsoir@gmail.com>)
List pgsql-novice

You may have to set permissions for the "tektroniks" directory

$ cd  /Users/aironman/Documents
$ mkdir tektroniks
$ chown tom tektroniks
$ chmod 755 tektroniks
$ ls -la

On 9/15/2014 6:04 AM, 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"
>


--
siamo arrivati sani e salvi



pgsql-novice by date:

Previous
From: Albe Laurenz
Date:
Subject: Re: newbee, about a bulk loading from a cdv file
Next
From: Magnus Persson
Date:
Subject: Backup options?