[GENERAL] Querying a policy

Поиск
Список
Период
Сортировка
От Jean-Francois Bernier
Тема [GENERAL] Querying a policy
Дата
Msg-id BN6PR02MB2705D93170FB17E561665CDCFDEC0@BN6PR02MB2705.namprd02.prod.outlook.com
обсуждение исходный текст
Список pgsql-general

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

 

В списке pgsql-general по дате отправления:

Предыдущее
От: Paul Hughes
Дата:
Сообщение: Re: [GENERAL] Python versus Other Languages using PostgreSQL
Следующее
От: Tom Lane
Дата:
Сообщение: Re: [GENERAL] Logical decoding CPU-bound w/ large number of tables