relation does not exist loading .tbl tables
Hi,
I've created schema and tables, then i must load .tbl data in these tables but I have the error relation does not exist! what's wrong?
dbvertica=> \set t_dbvertica 'dbvertica'
dbvertica=> \set input_file '''':t_dbvertica'/home/nicola/Scrivania/part.tbl'''
dbvertica=> COPY part FROM :input_file DELIMITER '|' NULL '' DIRECT;
ERROR 4566: Relation "part" does not exist
I've created ssb schema following ssb column definition in appendix a(last 2 pages)
http://www.cs.umb.edu/~xuedchen/research/publications/StarSchemaB.PDF
I've created schema and tables, then i must load .tbl data in these tables but I have the error relation does not exist! what's wrong?
dbvertica=> \set t_dbvertica 'dbvertica'
dbvertica=> \set input_file '''':t_dbvertica'/home/nicola/Scrivania/part.tbl'''
dbvertica=> COPY part FROM :input_file DELIMITER '|' NULL '' DIRECT;
ERROR 4566: Relation "part" does not exist
I've created ssb schema following ssb column definition in appendix a(last 2 pages)
http://www.cs.umb.edu/~xuedchen/research/publications/StarSchemaB.PDF
0
Comments
Can you check with "COPY schema_name.table_name FROM" syntax for COPY command.
Regards'
Abhishek
dbvertica=> COPY dbvertica.part FROM :input_file DELIMITER '|' NULL '' DIRECT;
ERROR 2886: Could not open file [dbvertica/home/nicola/Scrivania/part.tbl] for reading; file or directory doesn't exist
HINT: Make sure the file is available on the specified node. If using ON ANY NODE, it must be available at this path on all nodes in the cluster since any node could load the file
I think the problem is the directory because i'm newbie of vertica and probably i failed setting t_dbvertica!
how I should set it?
If your file is on path : /home/nicola/Scrivania/part.tbl
just \set input_file '/home/nicola/Scrivania/part.tbl'
Then use your copy command:
COPY dbvertica.part FROM :input_file DELIMITER '|' DIRECT;
Regards'
Abhishek
dbvertica=> \set input_file '/home/nicola/Scrivania/part.tbl'
dbvertica=> COPY dbvertica.part FROM :input_file DELIMITER '|' NULL '' DIRECT;
ERROR 4856: Syntax error at or near "/" at character 26
LINE 1: COPY dbvertica.part FROM /home/nicola/Scrivania/part.tbl DEL..
IT is giving error as quotes are not being put in copy syntax - as inherited from :input_file
Do it like this:
dbadmin=> \set input_file '\'/home/nicola/Scrivania/part.tbl\''
dbadmin=> COPY dbvertica.part FROM :input_file DELIMITER '|' NULL '' DIRECT;
I hope this should work for you.
Regards'
Abhishek
I've got this error:
dbvertica=> \set input_file '\'/home/nicola/Scrivania/part.tbl\''
dbvertica=> COPY dbvertica.part FROM :input_file DELIMITER '|' NULL '' DIRECT;
ERROR 2886: Could not open file [/home/nicola/Scrivania/part.tbl] for reading; Permiss denied
HINT: Make sure the file is available on the specified node. If using ON ANY NODE, it must be available at this path on all nodes in the cluster since any node could load the file
Check permissions of the file you are accessing. It should have read permission for user dbvertica.
Regards'
Abhishek
What is the rror message that you see.
Can you do vi /home/nicola/Scrivania/part.tbl
dbvertica=> \set input_file '\'vi /home/nicola/Scrivania/part.tbl\''
dbvertica=> COPY dbvertica.part FROM :input_file DELIMITER '|' NULL '' DIRECT;
ERROR 2886: Could not open file [vi /home/nicola/Scrivania/part.tbl] for reading; File o directory doesn't exist
HINT: Make sure the file is available on the specified node. If using ON ANY NODE, it must be available at this path on all nodes in the cluster since any node could load the file
dbvertica=>
Please exit from database with
dbvertica=> \q
Then execute below command from linux
vi /home/nicola/Scrivania/part.tbl
Now please execute below command after connecting to database.
dbvertica=> COPY dbvertica.part FROM '/home/nicola/Scrivania/part.tbl' DELIMITER '|' NULL ' ' DIRECT;
Type: \h or \? for help with vsql commands
\g or terminate with semicolon to execute query
\q to quit
dbvertica=> COPY dbvertica.part FROM '/home/nicola/Scrivania/part.tbl' DELIMITER '|' NULL ' ' DIRECT;
ERROR 2886: Could not open file [/home/nicola/Scrivania/part.tbl] for reading; Permiss denied
HINT: Make sure the file is available on the specified node. If using ON ANY NODE, it must be available at this path on all nodes in the cluster since any node could load the file
[nicola@localhost Scrivania]$ ls -lrt part.tbl
-rwxrwxrwx. 1 dbadmin dbadmin 17137664 30 dic 12.51 part.tbl
su dbadmin
Then execute below comand:
vsql -c "COPY dbvertica.part FROM '/home/nicola/Scrivania/part.tbl' DELIMITER '|' NULL ' ' DIRECT;"
[nicola@localhost Scrivania]$ su - dbadmin
Password:
[dbadmin@localhost ~]$ vsql -c "COPY dbvertica.part FROM '/home/nicola/Scrivania/part.tbl' DELIMITER '|' NULL ' ' DIRECT;"
ERROR 2886: Could not open file [/home/nicola/Scrivania/part.tbl] for reading; Permiss denied
HINT: Make sure the file is available on the specified node. If using ON ANY NODE, it must be available at this path on all nodes in the cluster since any node could load the file
[dbadmin@localhost ~]$
Could you try one more thing? Try "su dbadmin"; then "ls -l /home/nicola/Scrivania/part.tbl".
(If that gives "Permission Denied", then either move the file or change the permissions on its parent directories until the command works. We can help with that if you're not sure how.)
Thanks,
Adam
Thanks
It certainly is a permission issue.
I would like you to put file "part.tbl" in "/home/dbadmin" directory.
Steps:
1.
cd /home/nicola/Scrivania/
cp part.tbl /home/dbadmin
2.
su - dbadmin
3.
dbadmin=> COPY dbvertica.part FROM '/home/dbadmin/part.tbl' delimiter '|' DIRECT;
Regards'
Abhishek
cp: cannot execute stat of"/home/dbadmin/part.tbl": Permiss denied