Re: [GENERAL] Querying a policy

2017-05-11 Thread Jean-Francois Bernier
Stephen,

Thank you for the quick reply!  This information is very useful to me.

Maybe some more questions will come in the future :)

Thanks again and continue the good work!


-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


[GENERAL] Querying a policy

2017-05-10 Thread Jean-Francois Bernier
Hi all!

We are evaluating migrating our software RLS to Postgres by using policies.

Having a "FOR UPDATE POLICY" on a table, I was wondering if there is a way to 
know, before trying an Update and getting an error, if the current row can be 
updated ?

The goal is to show or hide the edit button in my software forms or lists.

I know that this query can return the CHECK condition of my POLICY:
SELECT pg_get_expr(polwithcheck, polrelid, true) FROM pg_policy;

But is there a simpler way to get the ids the current user can read and the 
ones that he can update?

Thank you!

Jeff