SQLTeam.com | Weblogs | Forums

Create privileges for user to see his own data by his id

There is a user, he has a name, and an ID.
There is exactly the same user and a different ID.
It is necessary to give privileges so that the user can only see his data

I try it somehow, but nothing happens.

[SQL] CREATE POLICY rental_rls_policy ON rental FOR all TO public USING (customer_id = current_user);
CREATE POLICY payment_rls_policy ON payment FOR all TO public USING (customer_id = current_user); [/ SQL]

there are permissions like

grant read

deny write

look up the syntax

please google search

Please Google Serach

Is this for Microsoft sql server or Postgres