That’s the risk when separation of duties isn’t baked into your workflow. Pgcli is powerful. Too powerful when every developer, tester, and admin shares the same permissions. Clean division between who can read, who can write, and who can alter structure is not optional—it’s survival.
With Pgcli, separation of duties starts by creating clear user roles in PostgreSQL. One role for read-only queries. One role for schema changes. One for maintenance. Then configure Pgcli to connect using those roles, not generic superuser accounts. This stops casual commands from turning into catastrophic data loss.
The best setups go further. They use auditing to log every Pgcli session. They enforce MFA on database accounts. They disable superuser login for daily work. They keep production direct access off-limits, funneling all interaction through controlled staging and review flows. Pgcli works seamlessly in these boundaries when paired with PostgreSQL’s role and privilege features.