SQLite User Forum

Secure delete and updating blob
Login

Secure delete and updating blob

(1) By anonymous on 2026-06-29 12:23:44 [link] [source]

Hey

I read the documentation but I want to make sure for this case. If I update a big blob that has 10 bytes, to now have 9 bytes, does that mean that removed bytes is replaced by zero? Does it mean secure delete will overwrite anything unused with delete? For example the overflow pages.

(2) By cj (sqlitening) on 2026-07-03 19:48:35 in reply to 1 [link] [source]

https://sqlite.org/forum/forumpost/3b069c23f786e8d724c92954d717f89cec8431cc68d068bb72afe19dd7542b46 ?

(3) By Simon Slavin (slavin) on 2026-07-04 14:37:42 in reply to 1 [source]

How are you updating the BLOB ? Are you replacing the entire value using UPDATE ?

Replacing an entire BLOB value works the same way as replacing any other value: the entire table row is rewritten, which means the database page is rewritten, and the security-related PRAGMAs work as documented.

There is a SQLite API for editing BLOBs, documented at https://sqlite.org/c3ref/blob_open.html . That page says

The size of a blob may not be changed by this interface. Use the UPDATE SQL command to change the size of a blob.

(4) By anonymous on 2026-07-05 08:29:15 in reply to 3 [link] [source]

I am using UPDATE. Thank you.