3 ms·
> Likewise you can specify a database connection as read-only We emulate that in prod by having admin users with read only permissions. They are granted other
by ht85 4y ago
> Likewise you can specify a database connection as read-only
We emulate that in prod by having admin users with read only permissions. They are granted other roles without the INHERIT option, thus needing an explicit `SET ROLE ...` before being able to do anything dangerous.
I also teach people the habit of combining `BEGIN; SET ROLE ...` everytime they need to write something. It has completely stopped "woops prod" incidents since it was implemented.