SQLite Forum

Serious problems with STORED columns
Login
> It's illogical the before and after (dump reloaded) state of the table to not be the same.

That's false. A dump isn't in any way under contract to preserve the "state" of the DB, only the Schema and persistent Data.

Put another way - if you had a view in your DB like this:

```
CREATE VIEW AS SELECT datetime('now') AS HereAndNow;
```

and you dump that DB and then restore it, would you expect the view to still show the old date and time from before you dumped it?
Would you complain that the DB isn't exactly the same after restoring it?

No, of course not, it's silly. Well a calculated column is in principle a VIEW based on other columns/expressions. It will change whenever it is referenced, or in the case of it having the "STORED" property in SQLite specifically, whenever the row is written - which happens to happen at the moment you INSERT or UPDATE (or restore) that row.

You know what doesn't change? A normal column. Maybe try one of those? :)