newbee, about a bulk loading from a cdv file

From: Alonso Isidoro Roman <alonsoir(at)gmail(dot)com>
To: pgsql-novice(at)postgresql(dot)org
Subject: newbee, about a bulk loading from a cdv file
Date: 2014-09-15 10:04:27
Message-ID: CAKR5Mf04Wb25OYm+B01eZak25B3TROrK6i13zXuGjaFBtZKJPg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

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"

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message Albe Laurenz 2014-09-15 10:25:51 Re: newbee, about a bulk loading from a cdv file
Previous Message Jake O'brien Fagan 2014-09-11 21:30:27 Postgresql replication not starting after running pg_basebackup