SQLite Forum

Serious problems with STORED columns
Login
This is how computed columns work.  You do not want a computed column, you want a default:

```
create table log
(
  dt text not null on conflict replace default current_timestamp check (dt IS datetime(dt, '+0 days')),
  msg text collate nocase not null,
  unique (dt, msg)
);
create trigger log_noupdate before update on log
begin
  select raise(ABORT, 'Cannot update log');
end;
insert into log(msg) values('a');
insert into log(msg) values('b');
insert into log(msg) values('c');
```

Edited to fix syntax error and trigger.