2017-05-27 51 views
0

使用SQLite3和Ubuntu 14.04-LTS。爲FTS搜索創建虛擬表時,我設法輸入了錯誤類型。現在我無法刪除表格。這就是我想要的東西:損壞的數據庫表不能刪除

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

但是,我必須打「5」,而不是「4」,現在我不能DROP表。當我嘗試我得到這個錯誤:

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

我搜索,發現SQLite3的爲終端(CLI)的信息,但我不知道如何中使用的命令。

我該如何修復?我有數百行數據和十幾個表格,所以我不能用相同的表格創建一個新的數據庫。

回答

0

問題解決了:找到個以下「

Drop a table originally created with 'unknown tokenizer'?

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'; 

非常感謝CL爲郵政