Choose your database:
AnySQL
MySQL
MS SQL Server
PostgreSQL
SQLite
Firebird
Oracle
SQL Anywhere
DB2
MaxDB

Subscribe to our news:
Partners
Testimonials
Patric Michael: "Thank you for a wonderful product, and all the hard work you've obviously taken".
Daryl Joubert: "I am evaluating your PostgreSQL Maestro product for purchase by my company and thus far I am very impressed! I really like the easy, intuitive and productive user interface and feature set. I am also evaluating a number of other products for PostgreSQL database design and maintenence but thus far SQLMaestro stands head and shoulders above the rest".

More

Add your opinion

PostgreSQL Maestro online Help

Prev Return to chapter overview Next

Row Security Policies

Row Security Policies have been implemented in PostgreSQL 9.5. They allow you to restrict, on a per-user basis, which rows can be returned by normal queries or inserted, updated, or deleted by data modification commands. Note that row-level security must be enabled on the table (using ALTER TABLE ... ENABLE ROW LEVEL SECURITY) in order for created policies to be applied.

 

 

Command

The command to which the policy applies. Valid options are ALL, SELECT, INSERT, UPDATE, and DELETE. ALL is the default.

 

Roles

The role(s) to which the policy is to be applied. The default is PUBLIC, which will apply the policy to all roles.

 

Using Expression

Any SQL conditional expression (returning boolean). This expression will be added to queries that refer to the table if row level security is enabled. Rows for which the expression returns true will be visible. Any rows for which the expression returns false or null will not be visible to the user (in a SELECT), and will not be available for modification (in an UPDATE or DELETE).

 

Check Expression

Any SQL conditional expression (returning boolean). This expression will be used in INSERT and UPDATE queries against the table if row level security is enabled. Only rows for which the expression evaluates to true will be allowed.



Prev Return to chapter overview Next