4 ms·
Ha, I thought about RLS on system catalogs, but it's not supported. Here is a long thread about it: http://postgresql.nabble.com/Multi-tenancy-with-RLS-td586211
by pjungwir 10y ago
Ha, I thought about RLS on system catalogs, but it's not supported. Here is a long thread about it: http://postgresql.nabble.com/Multi-tenancy-with-RLS-td5862118.html http://postgresql.nabble.com/Multi-tenancy-with-RLS-td586211...
It is also possible to revoke privileges on pg_namespace, but that breaks too many things for my taste (\dt e.g.).
I think I worked around the deadlock issue by detecting the failure in application code and trying again. It was for background workers in a side-project SaaS I abandoned after a few months, so a sloppy fix was very tolerable. I like your SELECT FOR UPDATE idea though!