Attempted update of read-only database

This error can obviously happen when you try to UPDATE some database which is marked read-only. It does not mean that the database file is read-only, but it contains a read-only mark. To change this, you can use the gfix tool.

gfix -mode read_only /path/to/database.fdb
gfix -mode read_write /path/to/database.fdb

This error can also show up when you only do SELECT statements, if the select involves a BLOB field that uses a different character set then the connection character set. In such case, Firebird tries to create a temporary copy BLOB in order to transliterate the data and it fails if database file is read-only.

Please note that many system tables have BLOB fields, so it is possible that your code never tries to do anything, but the code in your database access library might want to read some information from system tables and it might fail mysteriously. Since system tables store data in UNICODE_FSS character set, it is easy to test if this is the problem. Just change your connection character set to UNICODE_FSS and see if the problem would go away. (Since both character sets are the same, there would be no need for transliteration and temporary BLOB).

Do you find this FAQ incorrect or incomplete? Please e-mail us what needs to be changed. To ensure quality, each change is checked by our editors (and often tested on live Firebird databases), before it enters the main FAQ database. If you desire so, the changes will be credited to your name. To learn more, visit our add content page.

All contents are copyright © 2007-2024 unless otherwise stated in the text.

Links   Firebird   News   FlameRobin   Powered by FB: Home Inventory   Euchre  
Add content   About  

 Installation and setup
 Backup and restore
 Connectivity and API
 Errors and error codes