Open rmloveland opened 1 year ago
cc @rafiss found while working through your feedback to https://github.com/cockroachdb/docs/pull/15433
Using COPY with -e
is not well tested or supported. It's meant to be used in an interactive terminal:
root@localhost:26257/defaultdb> CREATE TABLE IF NOT EXISTS setecastronomy (name STRING, phrase STRING);;
CREATE TABLE
root@localhost:26257/defaultdb> COPY setecastronomy FROM STDIN WITH CSV DELIMITER ',' ESCAPE '\';
Enter data to be copied followed by a newline.
End with a backslash and a period on a line by itself, or an EOF signal.
>> cat,dog
>> hello,world
>> \.
COPY 2
root@localhost:26257/defaultdb> select * from setecastronomy;
name | phrase
--------+---------
cat | dog
hello | world
(2 rows)
But the behavior you ran into is definitely confusing. We can use this ticket to make sure a better message is shown if someone uses -e
with COPY.
We have marked this issue as stale because it has been inactive for 18 months. If this issue is still relevant, removing the stale label or adding a comment will keep it active. Otherwise, we'll close it in 10 days to keep the issue queue tidy. Thank you for your contribution to CockroachDB!
Trying to use
COPY
from stdin with cockroach sql on v22.2.0-beta.4. There appear to be multiple issues:Details below.
Insecure
demo
cluster started as followsTried to send it some data from a CSV file as follows, and get confusing SSL error:
If I do what the
COPY
error says and useCOPY
by itself, everything appears to work as expected:Aside: However, the data is not in the DB even though the command above reported back return value of 0 "everything is fine". Should I file a separate bug for that?
The SSL error appearing in this context seems like a bug since this is an insecure demo cluster being connected to from a SQL client that passed
--insecure
.As shown above the cluster and SQL client are the same version if it matters. Apologies if missing something obvious here.
Jira issue: CRDB-21063