As I wrote on the original thread, we recommend using the RDBMS row-level security features.
This blog discusses how to do that on Postgres
https://www.2ndquadrant.com/en/blog/application-users-vs-row...
This blog discusses how to do that on Postgres
https://www.2ndquadrant.com/en/blog/application-users-vs-row...