User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.97 Safari/537.36
The COPY ... ON CLIENT feature of the Apr2019 MonetDB release (11.33.3) is not working on Windows. Given the error message, it seens that the feature is not implemented. (Well, I'm guessing it's a Windows problem since I haven't tried it on Linux). The feature is not working even when the server is started at localhost.
Steps to Reproduce:
1. Start MonetDB server (could be localhost or remote computer, it doesn't matter because the same apply to both situations).
2. Create some dummy table
CREATE TABLE xyz (name VARCHAR(255), age INTEGER);
3. Create some dummy file (myfile.txt)
4. Try to import data from file using COPY ... ON CLIENT
COPY 3 RECORDS OFFSET 2 INTO xyz
FROM 'C:/Users/Public/Downloads/myfile.txt' ON CLIENT
USING DELIMITERS '|', '\n', '"' NULL AS '';
#client1:!ERROR:MALException:sql.copy_from:cannot transfer files from client
Table with values.
Which client are you using?
That is kind of important, since the feature requires support from both server and client program.
Ok, this is a good question since I tried to replicate the issue using both DBeaver (using the JDBC Driver) and R (using the MonetDB.R driver) but not mclient. Surprisingly, when I tested the use of COPY ... ON CLIENT in mclient it worked fine both for localhost and for a remote server. Is this feature supposed to work only through mclient?
In DBeaver, when I'm at localhost and change the query from ON CLIENT to ON SERVER, the data is loaded into the table.
In R I tested this commands:
conn = dbConnect(
drv = MonetDB.R::MonetDB.R(),
host = "localhost",
dbname = "ipea",
port = 50000L,
user = "monetdb",
password = "monetdb",
timeout = 86400L
dbSendQuery(conn, "CREATE TABLE xyz (name VARCHAR(255), age INTEGER);")
"COPY 3 RECORDS OFFSET 2 INTO xyz
FROM \'C:/Users/Public/Downloads/myfile.txt\' ON CLIENT
USING DELIMITERS \'|\', \'\n\', \'\"\' NULL AS \'\';")
The same apply: if I change ON CLIENT to ON SERVER, the data is loaded into the table.
The feature has only been implemented in mclient. It is possible to implement in other clients, but that hasn't happened as yet.
FYI: I have updated the documentation for COPY INTO commands on:
It now includes information that the ON CLIENT option is currently only supported by mclient program and not supported in other programs or APIs (ODBC, JDBC, python DBI, etc.).
It is not a bug. Changed it to an enhancement request.