-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On 2013-12-06 10:38, Lee Hachadoorian wrote:
I need to bulk load some files with characters like ñ and é. I would do this using the LATIN1 encoding. I read that bulk loading from file assumes UTF8, but bulk loading from STDIN will use encoding of mclient. I would like to know:
(a) How do I determine and change the client encoding? (b) What is an example for piping STDIN to mclient?
Regarding the latter, I tried:
cat /my/file.csv | mclient -d mydb -u monetdb -s "COPY INTO mytable FROM (STDIN) USING DELIMITERS ',', '\n' , '"' NULL AS '';"
I wasn't sure how the embedded " would be handled, but the terminal basically became unresponsive until I ctl-C'ed out of it. Note the the file was similar in size to several others (without non-UTF8 characters) that loaded in seconds within mclient.
Best, --Lee
See [1] for recipes for bulk loading, including the relevant invocation of mclient. The default character set that mclient uses depends on the environment. You can specify a specific character set using the -E option. See the manual at [2]. Quoting commands is an art. Look at the command in [1] how you can do it correctly. Hint: when quoting using double quotes ("), you need to use a backslash (\) to quote embedded backslashes and double quotes. [1] http://www.monetdb.org/Documentation/Cookbooks/SQLrecipes/LoadingBulkData [2] http://www.monetdb.org/Documentation/mclient-man-page - -- Sjoerd Mullender -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.15 (GNU/Linux) Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQCVAwUBUqGr8D7g04AjvIQpAQJuvAP/V1QHpkmSCw7LvU8/yny5pbPXlrbX4/08 kj/r0d/uy6GdpBj2NQSECmBtleBntDzU025fY57nqge6QnwjC97vFdQuunjSbC7s wTzA5CCICTh9zUP0vM87K0dN/GpNVbcCQBVG0haf492eF6Tn7Xh41g4I6+N6o8+D vAXpsveTSLc= =WXvD -----END PGP SIGNATURE-----