Revoke a specific query in PostgreSQL

1

Well the question is this,

A User may indicate in a query the name of the patients who DO NOT have an associated card, but another user will not be able to make THIS query.

Can you revoke that permission? because the easiest thing would be to revoke a general selection in the table, but if it could be done it would be great.

    
asked by GinoGiovanni 10.04.2016 в 06:49
source

1 answer

0

One way you can define a role, where you define users with Select permissions on the table to perform the query. Users who are not in this role can not make the query.

Assigns select permissions on the patient table for role usuarios_pacientes :

GRANT SELECT ON pacientes TO usuarios_pacientes;

You can add users to your role:

GRANT usuarios_pacientes TO hawks;

Remember that you can assign permissions to different objects: table, column, view, foreign table, sequence, database, foreign-data wrapper, foreign server, function, procedural language, schema, or tablespace.

In the documentation , you can get more information .

    
answered by 10.04.2016 / 08:05
source