Let me start off by saying I like the direction cockroach is headed. Doing some tests with a generic test db to see how well it works for our use case in an upcoming project…
Dropping table and recreating table works well enough, but this should too:
root@10.0.4.91:26257/employees> TRUNCATE TABLE employees;
pq: “employees” is referenced by foreign key from table “dept_manager”
Above sounds reasonable, had to disable cascade on delete as that isn’t supported yet AFAIK, except…
root@10.0.4.91:26257/employees> select * from dept_manager
-> ;
±--------±-------±----------±--------+
| dept_no | emp_no | from_date | to_date |
±--------±-------±----------±--------+
±--------±-------±----------±--------+
(0 rows)
so there are no rows to complain about…
Somewhat related note, would be nice if delete supported a LIMIT option. Deleting large number of rows is very slow and ends up with pq: transaction deadline exceeded…