Pcornel
Browse topics
Options
Recent
Favorites
Databases · Technical reference

PostgreSQL

Direct answer

PostgreSQL is an open-source relational database with MVCC, WAL, rich types and extensions, configured in postgresql.conf and pg_hba.conf and managed with psql.

When to use this

Use it to operate or troubleshoot PostgreSQL servers.

First 30 seconds

1. pg_lsclusters / systemctl status postgresql; server log.

2. Connections: SELECT count(*) FROM pg_stat_activity; vs max_connections.

3. Autovacuum and bloat.

4. Disk for data and WAL.

5. Replication: pg_stat_replication.

Operational verification

client → pg_hba auth → backend process → shared buffers/WAL → data files

Evidence · next step

Frequent failures include pg_hba/authentication mismatches, WAL retention filling disks, long transactions preventing vacuum cleanup, autovacuum lag, replication slots retaining WAL and assuming pg_dump is equivalent to a physical/PITR-capable backup. Preserve the first divergent observation and repeat the same bounded verification after remediation.

Continue only after interpreting the current observation.
Context & applicabilityCommon mistakes · platform/version boundaries
Common mistakes
What not to infer

Databases owns PostgreSQL engine and WAL/VACUUM behavior. Host, storage and general network issues remain in their owning Domains.

Platform / version applicability
MariaDB / MySQL / PostgreSQL / Microsoft SQL Server concepts
applies
Structured applicability is explicit Topic metadata; it does not infer compatibility beyond the stored rows.
At a glance

Operational reference

Fast context before you go deeper.

PlatformMariaDB / MySQL / PostgreSQL / Microsoft SQL Server concepts · Databases owns PostgreSQL engine and WAL/VACUUM behavior. Host, storage and general network issues remain in their owning Domains.
Scope / prerequisiteUse it to operate or troubleshoot PostgreSQL servers.
What next?3 suggested next steps
Child topics (this level)3
Evidence1
On this pageJump to a specific section
Operational workflow

Verification & Troubleshooting

Start with the observed symptom, prove the nearest boundary, and move outward only when the current state is understood.

2 steps Observe → verify → isolate → change minimally → repeat the original test.
ObservedRecord what the original test actually shows

Capture the concrete output, symptom, packet, log or counter before changing anything.

Step 1 Verification workflow Verify boundary

Confirm PostgreSQL version/cluster, database/role context and effective configuration. Check connection rules, WAL generation/retention, autovacuum health and table bloat indicators. Validate backup by restore, and validate replicas by receive/replay positions plus queryable service state.

Step 2 Failure signatures and limits Narrow the fault

Frequent failures include pg_hba/authentication mismatches, WAL retention filling disks, long transactions preventing vacuum cleanup, autovacuum lag, replication slots retaining WAL and assuming pg_dump is equivalent to a physical/PITR-capable backup.

Evidence references

Evidence · 1 on this Topic

Expected observations and documentation recipes are reference material. Record actual output, device identity, scope and time before claiming a verified result.

test · 1
Drill down

Subtopics

Go one level deeper into this subject.

Key points

Watch connections (use a pooler), autovacuum, WAL/disk, and pg_hba.conf for access. pg_stat_statements shows the heaviest queries.

Key checks
  • SELECT * FROM pg_stat_activity; — sessions
  • psql -c "SELECT now(), version();" — PostgreSQL reachable and version
  • mysql -e "SELECT NOW(), VERSION();" — MariaDB/MySQL reachable and version
  • sqlcmd -S <server> -Q "SELECT @@VERSION" — SQL Server reachable and version
ReferenceWhat it is1 section · depth on demand

Operating model

PostgreSQL covers the PostgreSQL cluster/server model, roles/databases, WAL durability, vacuuming, configuration/logging, backup choices and streaming replication. PostgreSQL MVCC leaves dead tuples that require vacuum management; WAL is central to crash recovery, replication and point-in-time recovery.

ReferenceHow it works1 section · depth on demand

In depth

PostgreSQL is an advanced open-source relational database known for standards compliance, reliability, rich data types (JSONB, arrays, inet, ranges) and extensions (PostGIS, TimescaleDB, pgvector). It is the default choice for many new applications, including NetBox.

Operational essentials:

AreaPractice
Configurationshared_buffers ~25% RAM, effective_cache_size, work_mem carefully; connection pooling (PgBouncer) for many clients
VacuumAutovacuum tuned and monitored; avoid long-running transactions
Backuppg_dump (logical), pg_basebackup + WAL archiving or pgBackRest/Barman for PITR
ReplicationStreaming replication, logical replication; Patroni for automated failover
Securitypg_hba.conf restrictions, SCRAM-SHA-256 passwords, TLS, least-privilege roles
Monitoringpg_stat_activity, pg_stat_statements, replication lag
SELECT pid, state, wait_event_type, now()-xact_start AS xact_age, left(query,60)
FROM pg_stat_activity WHERE state <> 'idle' ORDER BY xact_age DESC NULLS LAST;

Major version upgrades need pg_upgrade or logical replication — plan them, since each major version is supported for five years.

ReferenceImportant terms & boundaries1 section · depth on demand

Scope map

  • Server/cluster architecture
  • Roles and databases
  • WAL
  • VACUUM / autovacuum
  • Configuration and logs
  • pg_dump/base backup boundaries
  • Streaming replication
Additional reference context Scope · expected state · examples · history · terminology Open only when you need the supporting context
Technical examples

Configuration & expected output

Concrete examples are shown only when the stored reference contains an actual configuration or output shape for this Topic.

Configuration example

PostgreSQL PostgreSQL 14 or laterListen address and host-based authentication for application clients.

Assumptions: Debian/Ubuntu paths; application subnet 10.0.20.0/24.

# postgresql.conf
listen_addresses = '10.0.10.22'
password_encryption = scram-sha-256

# pg_hba.conf
# TYPE   DATABASE  USER    ADDRESS         METHOD
hostssl  app       app_rw  10.0.20.0/24    scram-sha-256

Expected output

PostgreSQL PostgreSQL 14 or laterpsql -c "SELECT pg_reload_conf();" && psql -c "SELECT type, database, user_name, address, auth_method FROM pg_hba_file_rules WHERE error IS NULL;"

Expected state: The reloaded pg_hba rules contain the intended rule with no parse errors.

type   | database |  user_name | address    |  auth_method
---------+----------+------------+------------+---------------
 local   | {all}    | {postgres} |            | peer
 hostssl | {app}    | {app_rw}   | 10.0.20.0  | scram-sha-256
Rules are matched top to bottom; the first match wins. listen_addresses needs a restart, pg_hba.conf only a reload. Illustrative authored output: field layout matches the tool, values will differ in your environment.
Technical verification history

Verification history & basis

When and against what this Topic was checked. Later text edits do not count as a new check.

2026-09-29 · otherMariaDB / PostgreSQL / Microsoft SQL Server concepts PostgreSQL current documentation

Documentation verification: confirms the upstream model used by the Topic. It does not assert local production behavior.

Basis: https://www.postgresql.org/docs/current/ · confidence 92%
Technical changelog & impact

What changed and what may be affected

Recent technical edits are separated from ordinary page timestamps. Relationship impact is advisory: it identifies nearby canonical references to review, not automatic breakage.

Related reference impactReview these references after material technical changes when their shared boundary is affected.
Terminology layer

Terms & aliases

Hover a linked term for a quick definition; click it to open its glossary entry. Aliases are other names that find this Topic in search.

Aliases that resolve here
postgresqlPostgreSQL operationsPostgres WALPostgreSQL vacuumPostgreSQL replication
Embedded reference data

Quick lookup tables

PostgreSQL verification boundary matrix

A compact lookup separating intent, owning component state, effective state and consumer-visible outcome for PostgreSQL.

BoundaryInspectHealthy interpretationDo not infer
IntentServer/cluster architectureIntended object/scope is explicit and versioned where relevantIntent is already effective
Owning runtime/control planeRoles and databases / WALOwner accepts and reports the expected object stateDownstream dependencies are healthy
Effective stateVACUUM / autovacuumIndependent read-back matches the intended stateEvery client sees the same result
Consumer outcomeConfiguration and logsThe original bounded check succeeds in the same time windowProduction correctness outside this scope
Depth when you need it

Deep reference

Design & tradeoffs

Scope

Host, storage and general network issues remain in their owning Domains.

Confirmation

Confirm action

Continue?