Any number of database namespacing techniques already present in postgresql can prevent this. Link the user sign-on to a DB user and you’re gold.
This blog discusses how to do that on Postgres
https://www.2ndquadrant.com/en/blog/application-users-vs-row...