How to dump data to "native" file format?
I'd like to dump data via vsql to a file to load into another Vertica database. My efforts to do this via EXPORT/COPY FROM VERTICA have failed for various reasons (seems like lack of proper community edition support for it, and version difference between v5 and v6 of the two DBs) I can export data using something like: vsql -U user -w pwd -h vertica.mydomain.com -d dbname -At -c "SELECT * from schema.users" > /migrate/users_export.txt And then load it in with: cat /migrate/users_export.txt | vsql -U user -w pwd -d dbname -c "COPY schema.users FROM STDIN DELIMITER '|';" The issue I'm hitting is that newlines in certain data fields cause the COPY command to miss data. For example, if a user has a biography field with new lines, it breaks in the output file. Ideally, I'd like to send the results of the SELECT statement output to 'native varchar' format, and load them like that. Is there an option for that? And is the native format compatible between major revisions? If not, any tips on properly escaping and reloading the data via COPY?
0
Comments
But how could I dump data in the native binary format?
By the way, you have an error in the signature for the native binary format, it should be '\377' instead of '\317' for the byte offset 7: https://my.vertica.com/docs/7.1.x/HTML/Content/Authoring/AdministratorsGuide/BinaryFilesAppendix/CreatingNativeBinaryFormatFiles.htm (Text literals).