This blog discusses how to do that on Postgres
https://www.2ndquadrant.com/en/blog/application-users-vs-row...