COPY FROM LOCAL Error: Throw syntax error at or near LOCAL

I'm executing a COPY FROM LOCAL comand from client (REHL) and encounter error:


ERROR: syntax error at or near "local" at character 771


My Copy comand as below: 

/home/ODBC/vertica/bin/vsql --host=host IP --port=port number --dbname=database name --username=dbusername --password=password -c "copy schemaname.tablename(col1, col2, col3) from local '/temp/datafile.txt' DELIMITER E'|' record terminator '<ER>' direct ENFORCELENGTH NO ESCAPE;"


please advise what coulld be possible reason of the error and its resolution.


please note that, same COPY command works fine when used with FROM STDIN as well as COPY FROM '/dbserver_temp/datafile.txt'; where '/dbserver_temp/datafile.txt' is located in database server node.


will truly appreciate any advise on this



  • Options
    SruthiASruthiA Vertica Employee Administrator



       Please try using the following syntax to load the data into database using COPY FROM LOCAL. I tested in my environment and was able to load successfully.


    [dbadmin@sanumula2 ~]$ /opt/vertica/bin/vsql --host=hostname --port=portnumber--dbname=database name --username=dbusername --password= password -c "COPY public. test1 FROM LOCAL 'testfile.txt' DELIMITER E'|' record terminator '<ER>' direct ENFORCELENGTH NO ESCAPE;"
    Rows Loaded
    (1 row)



    There is no need to specify the column list while specifying the table name.




Leave a Comment

BoldItalicStrikethroughOrdered listUnordered list
Align leftAlign centerAlign rightToggle HTML viewToggle full pageToggle lights
Drop image/file