-1

I know I could stop normal users from using UPDATE and DELETE by revoking permissions.

No-one (including DB admins) should be able to UPDATE or DELETE from these tables. (This is for a write-model in CQRS.)

I understand that tables will still be droppable.

How can I create append-only tables in Postgres?

1
  • @mustaccio Yes, thanks.
    – fadedbee
    Nov 18, 2021 at 13:27

1 Answer 1

2

Only the owner of an object (and a superuser) can drop a table or grant permissions on it.

So keep superusers and table owners under lock and key and don't grant UPDATE and DELETE to anybody else.

There is no way to protect yourself from a superuser, and protecting yourself from the table owner is difficult.

Not the answer you're looking for? Browse other questions tagged or ask your own question.