Security
Audit Row-Level Security Policies with pg_policies
Aug 31, 2026 / · 11 min read · postgresql database administration sql queries row-level security pg_policies access control security catalogs postgres dba ·Audit Row-Level Security Policies with pg_policies pg_policies turns a table's row-level security setup — however many CREATE POLICY statements are scattered across migration files — into one queryable inventory: one row per policy, with the roles it binds to, the command it governs, and the boolean expressions doing …
Read MoreAudit PostgreSQL Authentication with pg_hba_file_rules
Jul 20, 2026 / · 8 min read · postgresql database administration sql queries authentication pg_hba_file_rules pg_hba.conf security catalogs postgres dba ·Audit PostgreSQL Authentication with pg_hba_file_rules Validating a pg_hba.conf edit before trusting it in production usually means reading the raw file line by line and hoping the parser interprets every rule the way it looks on screen. pg_hba_file_rules skips that guesswork — it is a system view that shows how …
Read MoreList PostgreSQL Roles and Their Privileges
Apr 17, 2026 / · 8 min read · postgresql administration security pg_roles pg_auth_members pg_database ·How to List PostgreSQL Roles and Privileges Which accounts can log in, which can create databases or other roles, and which are quietly superusers? PostgreSQL answers all three from pg_roles, a view over the role catalog that every user can read. Joined to pg_auth_members it also shows who belongs to which group, and …
Read MoreGRANT SELECT on All Tables in PostgreSQL — with Examples
Mar 27, 2026 / · 12 min read · postgresql database administration sql queries security access control permissions etl postgres dba pg_default_acl pg_class ·Grant SELECT on All Tables in PostgreSQL Third-party ETL connectors, BI platforms, and audit users all need read access to PostgreSQL tables — without write permissions that could corrupt production data. Granting SELECT table by table works until someone adds a new table and the connector silently skips it; ALTER …
Read MorePostgreSQL SSL Settings Query Guide
Mar 17, 2026 / · 5 min read · postgresql database administration sql queries security ssl configuration pg_settings postgres dba pg_stat_ssl ·PostgreSQL SSL Settings Query Guide This PostgreSQL query retrieves all SSL and TLS configuration settings from the pg_settings system view. It surfaces whether SSL is enabled, which certificates and keys are in use, what cipher suites are allowed, and all other SSL-related parameters. Purpose and Overview Encrypting …
Read MorePostgreSQL Authentication Settings Query for Admins
Aug 27, 2025 / · 3 min read · postgresql database authentication security sql scripts database management postgres configuration pg_settings ·PostgreSQL Authentication Settings Query for Admins Managing PostgreSQL at scale requires both fine-grained control and visibility into configuration parameters. One valuable system catalog, pg_settings, provides administrators direct insight into runtime parameters, defaults, and constraints that govern PostgreSQL’s …
Read More