How to Delete PostgreSQL Account on macOS

image

View all macOS users
$ /usr/bin/dscl . -list /Users

Delete a user

$ sudo /usr/bin/dscl . -delete /Users/<USER_ACCOUNT>
For example, to delete PostgreSQL

$ sudo /usr/bin/dscl . -delete /Users/PostgreSQL
Check again, it should be gone

$ /usr/bin/dscl . -list /Users

References

Answer source postgresql - How to delete Postgres on Mac - Stack Overflow
Introduction about dscl 真正的macOS创建、删除用户及密码操作:为什么设置中用户与群组里没有其他用户但创建postgres用户时却显示名称已被另一个用户使用 - Lovaer - 博客园

Derivative