Databases · DBC-21

PostgreSQL Administration

PostgreSQL Administration is a course in installing and running PostgreSQL 18 in production, covering security, backup and point-in-time recovery with pgBackRest, monitoring, replication, high availability with Patroni, major upgrades and Kubernetes. It suits DBAs, system administrators and DevOps teams who look after PostgreSQL.

Updated
From 8,010 THB / person 8,900 −10% excl. VAT 7% · group rates available
PDFDownload the course outline
  • Duration18 hours · 3 days
  • FormatOnsite / live online
  • Next round15–17 Dec 26
  • CertificateIncluded

Course overview

PostgreSQL has become the main database for many organizations, both for new systems and for systems migrated from Oracle, SQL Server or MySQL. Getting it installed and running is only the start. What keeps a system alive is tuning it for the hardware, controlling access and security, keeping vacuum healthy, taking backups that really restore, watching performance, and preparing for server failures without long outages.

This hands-on course covers PostgreSQL 18 administration end to end. It starts with the architecture, installation on Linux and Docker, and postgresql.conf tuning, including the asynchronous I/O introduced in 18, then moves to roles and privileges, SCRAM and OAuth authentication, TLS, Row-Level Security and pgAudit. Day two focuses on daily DBA work: autovacuum, pg_dump, incremental pg_basebackup, point-in-time recovery with pgBackRest, monitoring and PgBouncer. The final day covers replication, high availability with Patroni, major version upgrades with pg_upgrade, and the options on Kubernetes and in the cloud, closing with a capstone in which learners must fail over a cluster and restore data for real. (3 days, 6 hours per day, 18 hours in total, Intermediate to Advanced level.)

What you’ll gain

  • Explain the PostgreSQL architecture: processes, shared buffers, WAL, checkpoints and MVCC
  • Install PostgreSQL 18 on Linux and Docker and tune postgresql.conf for the hardware
  • Design roles, privileges and schemas, and set up authentication, TLS, RLS and auditing
  • Manage autovacuum and bloat and run routine maintenance without disrupting users
  • Plan backups and restore to a chosen point in time (PITR) with pgBackRest
  • Monitor performance with pg_stat_* views, pg_stat_statements, Prometheus and Grafana
  • Set up replication and high availability with Patroni and rehearse failover
  • Perform major upgrades with minimal downtime and choose an approach on Kubernetes or in the cloud

Who this course is for

  • DBAs who run, or are about to take over, PostgreSQL databases
  • System administrators and infrastructure teams who install and maintain database servers
  • DevOps and SRE teams running PostgreSQL in production on VMs, containers or the cloud
  • Teams migrating from Oracle, SQL Server or MySQL to PostgreSQL
  • Developers who now own their application's database in production

Prerequisites

  • Comfortable with the Linux command line, including files, permissions and services
  • Able to write basic SQL such as SELECT, INSERT, UPDATE and CREATE TABLE
  • Basic networking knowledge such as IP addresses, ports and SSH connections
  • A laptop that can run Docker, with permission to install software

Curriculum

Course Details

A 3-day course, 6 hours per day (18 hours in total, 09:00-16:00), delivered as lectures with labs on Linux containers with Docker. Intermediate to Advanced level. This course replaces the earlier PostgreSQL for Administration course, which was taught on version 9.4 with pgAdmin III, and has been rewritten for PostgreSQL 18, the current stable release. It covers new features such as asynchronous I/O, OAuth authentication, incremental backup and pg_upgrade that keeps planner statistics, along with the tools used in practice today: pgBackRest, PgBouncer, Patroni and CloudNativePG. Learners take home a lab guide, configuration files for every lab, and a DBA runbook for routine operations.

Day 1 Installation, Architecture and Security

Section 1: PostgreSQL Architecture and the Version Lifecycle

  • The process model: postmaster, backends, checkpointer, WAL writer and autovacuum
  • How shared buffers, WAL and checkpoints work together when data is written
  • MVCC, tuple versions and why PostgreSQL needs vacuum
  • The 5-year support policy: 9.x through 13 are end of life and PostgreSQL 18 is the current stable release
  • The risks of running unsupported versions, and a look at what is coming in PostgreSQL 19

Section 2: Lab: Installing PostgreSQL 18 on Linux and Docker

  • Install from the PGDG repository and manage the service with systemd
  • Run PostgreSQL 18 in Docker with a volume for persistent data
  • initdb, the data directory layout, and data checksums enabled by default in 18
  • Separate tablespaces and disks for data and WAL
  • Use psql like a professional and manage servers with pgAdmin 4

Section 3: Lab: Configuring postgresql.conf and Sizing for the Hardware

  • Configuration precedence, ALTER SYSTEM, and which settings need a restart or only a reload
  • shared_buffers, work_mem, maintenance_work_mem and effective_cache_size
  • max_wal_size, checkpoint_timeout and their effect on system I/O
  • Asynchronous I/O in PostgreSQL 18: io_method with worker and io_uring
  • Set up logging so problems can be analyzed from day one

Section 4: Roles, Privileges and Schemas

  • Roles, users and groups in PostgreSQL and privilege inheritance
  • GRANT and REVOKE at the database, schema, table and column level
  • Design schemas around least privilege for applications and teams
  • ALTER DEFAULT PRIVILEGES for objects created in the future
  • Predefined roles such as pg_read_all_data, pg_monitor and pg_maintain

Section 5: Lab: Authentication, TLS, RLS and Auditing

  • Write a tight pg_hba.conf and understand rule matching order
  • Move passwords to SCRAM-SHA-256, since MD5 passwords are deprecated in 18
  • OAuth authentication, new in PostgreSQL 18, and connecting it to an identity provider
  • Enable TLS for connections and enforce it with hostssl
  • Row-Level Security to separate data per user, and audit logging with pgAudit
Day 2 Maintenance, Backup and Performance

Section 6: Vacuum, Autovacuum and Routine Maintenance

  • Dead tuples, bloat and transaction ID wraparound
  • Tune autovacuum at the server level and per table for write-heavy tables
  • ANALYZE and the statistics the query planner relies on
  • Detect and reduce table and index bloat
  • REINDEX CONCURRENTLY and maintenance that does not lock out users

Section 7: Lab: Logical and Physical Backup

  • pg_dump and pg_restore: file formats, parallel jobs and selective restore
  • pg_dumpall for roles and global objects
  • pg_basebackup for backing up the whole cluster
  • Incremental backup and combining backups with pg_combinebackup
  • Choose a backup method that fits the data size and the organization's RPO/RTO

Section 8: Lab: WAL Archiving, PITR and pgBackRest

  • Set up WAL archiving and verify the archive is complete and continuous
  • Restore to a chosen moment with point-in-time recovery
  • pgBackRest: configure a repository and run full, differential and incremental backups
  • Define retention and keep backups off the database server
  • Run scheduled restore tests to prove the backups actually work

Section 9: Lab: Monitoring and Performance Analysis

  • pg_stat_activity, pg_stat_database and pg_locks for the current state
  • Find resource-heavy queries with pg_stat_statements
  • Inspect I/O load with pg_stat_io and read plans with EXPLAIN ANALYZE
  • Capture plans of slow queries automatically with auto_explain
  • Build dashboards with postgres_exporter, Prometheus and Grafana

Section 10: Lab: Connection Management with PgBouncer

  • The cost of a PostgreSQL connection and the problems with too many open connections
  • Install and configure PgBouncer in front of the database
  • Choose a pooling mode: session, transaction or statement
  • Limitations of transaction mode and adapting applications to it
Day 3 Replication, High Availability, Upgrades and Cloud

Section 11: Lab: Streaming Replication

  • Build a standby with pg_basebackup and enable hot standby for read queries
  • Synchronous versus asynchronous replication and the trade-off between latency and data loss
  • Replication slots: the benefits, and the risk of WAL piling up until the disk fills
  • Track replication lag and promote a standby manually

Section 12: Logical Replication

  • Publications and subscriptions for replicating selected tables or across versions
  • Failover slots in PostgreSQL 17 so subscribers keep working after a failover
  • Convert a physical standby into a logical subscriber with pg_createsubscriber
  • Limitations around DDL and sequences, and verifying data consistency

Section 13: Lab: High Availability with Patroni

  • The Patroni, etcd and HAProxy architecture and the role of each part
  • Build a 3-node cluster and manage it with patronictl
  • Rehearse a planned switchover and a failover when the primary goes down
  • Prevent split-brain and rejoin the old primary to the cluster

Section 14: Major Version Upgrades with Minimal Downtime

  • pg_upgrade in --link mode and the new --swap mode in 18, with pre-checks using --check
  • PostgreSQL 18 keeps planner statistics after pg_upgrade, so the system recovers faster
  • Upgrade through logical replication to cut downtime to the switchover window
  • Plan upgrades from old releases such as 9.x, test extensions and prepare a rollback plan

Section 15: PostgreSQL on Kubernetes and Managed Services

  • CloudNativePG: the operator, the Cluster resource, backup and failover on Kubernetes
  • AWS RDS and Aurora, Azure Database for PostgreSQL and Google Cloud SQL
  • What the provider handles and what the DBA still owns
  • Criteria for choosing between VMs, Kubernetes and managed services

Section 16: Lab: Capstone 3-Node HA Cluster

  • Build a 3-node Patroni cluster with pgBackRest and monitoring
  • Simulate a primary failure and verify failover and application reconnection
  • Simulate an accidental delete and restore to a point in time before the incident
  • Wrap up with a runbook and checklist for daily, monthly and emergency tasks

Schedule & training options

For individuals — public rounds

15–17December
Classroom15–17 Dec 26
20 seats left
23–25February
Classroom23–25 Feb 27
20 seats left
23–25March
Classroom23–25 Mar 27
20 seats left
5–7May
Classroom5–7 May 27
20 seats left
21–23July
Classroom21–23 Jul 27
20 seats left
14–16September
Classroom14–16 Sep 27
20 seats left
9–11November
Classroom9–11 Nov 27
20 seats left

For organisations — in-house / private

  • Tailor the content to your team’s tools and projects
  • Your dates, at your office or live online
  • Quotation with tax ID for procurement
Corporate training quote

Instructors

Frequently asked questions

What is point-in-time recovery in PostgreSQL, and how is it set up?

Point-in-time recovery (PITR) restores a database to a chosen moment, such as just before data was deleted by mistake, by combining a base backup of the cluster with a continuous archive of WAL files. Enable WAL archiving, take base backups with pg_basebackup or pgBackRest, and when you need to recover, restore the base backup and set recovery_target_time so WAL is replayed up to that point. Rehearse restores regularly to prove the backups work.

Why does PostgreSQL need VACUUM?

PostgreSQL uses MVCC, so UPDATE and DELETE do not remove the old row straight away; they leave dead tuples for transactions that may still read them. VACUUM reclaims that space for reuse, limits table and index bloat and prevents transaction ID wraparound. In production, tune autovacuum for write-heavy tables rather than switching it off or running VACUUM by hand.

What is the difference between synchronous and asynchronous replication?

With asynchronous replication the primary confirms a commit without waiting for the standby, which is faster, but the last few transactions can be lost if the primary fails. Synchronous replication waits for the standby to confirm it has received the WAL, so committed data is not lost, but write latency rises and writes can stall if the standby stops responding. The choice depends on how much data loss you can accept against speed.

Who is the PostgreSQL Administration course for, and what should I know beforehand?

It suits DBAs who look after or are taking on PostgreSQL, system administrators and infrastructure teams, DevOps and SRE teams running PostgreSQL in production, and teams migrating from Oracle, SQL Server or MySQL. You should be comfortable with the Linux command line, able to write basic SQL, and understand networking basics such as IP addresses, ports and SSH.

What will I be able to do after the PostgreSQL Administration course?

You will be able to install and tune PostgreSQL 18, set up roles, authentication and TLS, back up and restore to a chosen point in time with pgBackRest, monitor performance with Prometheus and Grafana, and build a high-availability cluster with Patroni and rehearse failover. Participants who complete the training receive a Certificate of Completion with its own number, which can be verified online.

Can the PostgreSQL Administration course be run in-house for our team?

Yes. It can be run in-house for your team, with examples adapted to your own work, such as your backup plan or an upgrade from the version you currently run. You can request a quotation from this page, or contact us on LINE @itgenius or by phone on 02-570-8449.