-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
See [1] for recipes for bulk loading, including the relevant
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
>
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