Corrupted Database Table cannot DROP

708 Views Asked by At

Using SQLite3 and Ubuntu 14.04-LTS. I managed to mis-type when creating a Virtual table for a FTS search. Now I cannot remove the Table. This is what I wanted:

CREATE VIRTUAL TABLE tFind USING FTS4(main TEXT, base TEXT, hash TEXT);

But, I must have hit "5" instead of "4" and now I can't DROP the table. When I try I get this error:

Error refreshing schema for table main.tFind : No such module FTS5

I searched and found information on SQLite3 for the Terminal (CLI), but I do not know how to use the commands within.

How can I repair this? I have many hundreds of rows of data and a dozen or so tables, so I cannot just create a new database with the same tables.

1

There are 1 best solutions below

0
On

Problem solved: Found th following "

Drop a table originally created with 'unknown tokenizer'?

Where the

And then use the (very dangerous) PRAGMA writable_schema to remove the remaining information about this table from the system table:

PRAGMA writable_schema = ON;
DELETE FROM sqlite_master WHERE type = 'table' AND name = 'tFind';

Many thanks to CL. for that Post.