Posts
Back Up All PostgreSQL Databases with pg_dumpall
Jun 9, 2026 / · 6 min read · pg_dumpall backup and recovery cluster backup global objects administration ·Back Up All PostgreSQL Databases with pg_dumpall Before a major-version upgrade or a disaster-recovery rehearsal, a DBA needs a single artifact that captures the whole cluster: every database, plus the global objects that live outside any one database. pg_dumpall produces exactly that — one plain-SQL script that …
Read MorePostgreSQL Advisory Locks with pg_advisory_lock
PostgreSQL Advisory Locks with pg_advisory_lock Two scheduled jobs fire at the same minute and both try to process the same nightly batch. Nothing in the data stops them — there is no single row to lock, because the work has not produced rows yet. Row and table locks are the wrong tool here. What you want is a named …
Read MoreList All PostgreSQL Triggers with Their State
List All PostgreSQL Triggers with Their State A disabled trigger is invisible until something it should have done goes missing. The audit row that never got written, the derived column that stopped updating, the constraint check that silently stopped firing — each traces back to a trigger left in the disabled state …
Read MorePostgreSQL Column-Level Permissions Audit Query
Jun 6, 2026 / · 6 min read · column_privileges information_schema permissions security audit administration ·PostgreSQL Column-Level Permissions Audit Query Which roles can read which columns? Table-level grants are easy to list, but they hide a finer layer of access. A role denied SELECT on a table can still hold SELECT on two of its columns, and that is exactly where personal data quietly stays reachable after a wider grant …
Read MoreList PostgreSQL Wait Events with the pg_wait_events View
May 25, 2026 / · 8 min read · pg_wait_events wait events system catalog postgresql 17 reference administration ·List PostgreSQL Wait Events with the pg_wait_events View PostgreSQL 17 added pg_wait_events, a system view that enumerates every wait event the running server can record. Prior to 17 the same information lived only in the documentation — no in-database way to confirm a wait name or attach a description to it. The view …
Read MoreIdentify Running PostgreSQL Autovacuum Worker Sessions
May 24, 2026 / · 7 min read · pg_stat_activity pg_stat_progress_vacuum autovacuum backend_type vacuum administration ·Identify Running PostgreSQL Autovacuum Worker Sessions Autovacuum lag is a slow accumulation. Every UPDATE rewrites the row and creates a new HOT chain, the launcher falls behind during write spikes, and over weeks a busy OLTP cluster ends up with three workers stuck on a handful of huge tables while smaller ones wait …
Read MoreMonitor PostgreSQL WAL Archiver Status with pg_stat_archiver
Monitor PostgreSQL WAL Archiver Status with pg_stat_archiver pg_stat_archiver is the canonical place to check whether PostgreSQL's continuous archiving is keeping up — a single-row view that exposes last_archived_wal, last_failed_wal, and the rolling failure count without parsing log files. On a healthy cluster the row …
Read MoreMonitor PostgreSQL Replication Lag with pg_stat_replication
May 22, 2026 / · 7 min read · pg_stat_replication replication wal standby monitoring administration ·Monitor PostgreSQL Replication Lag with pg_stat_replication A standby lagging more than a few seconds is rarely a transient hiccup — it is a query backlog on the standby, a network ceiling between the nodes, a misconfigured hot_standby_feedback, or a single-threaded apply storm. pg_stat_replication joined to …
Read MoreTune PostgreSQL Background Writer with pg_stat_bgwriter
May 21, 2026 / · 7 min read · pg_stat_bgwriter pg_stat_checkpointer background writer checkpointer performance administration ·Tune PostgreSQL Background Writer with pg_stat_bgwriter Where pg_stat_statements does query-level aggregation and pgBadger does after-the-fact log analysis, pg_stat_bgwriter operates at the buffer-cache layer — answering whether the bgwriter and checkpointer are keeping shared_buffers clean enough that foreground …
Read MoreMonitor PostgreSQL Wait Events Using pg_stat_activity
May 17, 2026 / · 3 min read · pg_stat_activity wait events performance monitoring session monitoring administration ·Understanding PostgreSQL Wait Events for Performance Analysis Every active PostgreSQL backend is either executing work or waiting. When a session waits, PostgreSQL records the reason in pg_stat_activity using two columns: wait_event_type and wait_event. Aggregating these across all sessions gives a clear picture of …
Read More