Search icon
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Learn PostgreSQL

You're reading from  Learn PostgreSQL

Product type Book
Published in Oct 2020
Publisher Packt
ISBN-13 9781838985288
Pages 650 pages
Edition 1st Edition
Languages
Concepts
Authors (2):
Luca Ferrari Luca Ferrari
Profile icon Luca Ferrari
Enrico Pirozzi Enrico Pirozzi
Profile icon Enrico Pirozzi
View More author details

Table of Contents (27) Chapters

Preface Section 1: Getting Started
Introduction to PostgreSQL Getting to Know Your Cluster Managing Users and Connections Section 2: Interacting with the Database
Basic Statements Advanced Statements Window Functions Server-Side Programming Triggers and Rules Partitioning Section 3: Administering the Cluster
Users, Roles, and Database Security Transactions, MVCC, WALs, and Checkpoints Extending the Database - the Extension Ecosystem Indexes and Performance Optimization Logging and Auditing Backup and Restore Configuration and Monitoring Section 4: Replication
Physical Replication Logical Replication Section 5: The PostegreSQL Ecosystem
Useful Tools and Extensions Toward PostgreSQL 13 Other Books You May Enjoy

Row-level security

In the previous part of the chapter, you have seen the permission mechanism by which PostgreSQL allows roles (both users and groups) to access different objects within the database and data contained in the objects. In particular, with regard to tables, you have learned how to restrict access to just a specific column list within the tabular data.

PostgreSQL provides another interesting mechanism to restrict access to tabular data: row-level security. The idea is that row-level security can decide which tuples the role can gain access to, either in read or write mode. Therefore, if the column-based permissions provides a way of limiting the vertical shape of the tabular data, the RLS provides a way to restrict the horizontal shape of the data itself.

When is it appropriate to use RLS? Imagine you have a table that contains data related to users, and you don't want your users to be able to tamper with other users' data. In such a case, restricting the access...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $15.99/month. Cancel anytime}