How to Deal with Slow Shutdown in PostgreSQL
Laurenz Albe explains why PostgreSQL shutdown can be slow: a clean shutdown runs a checkpoint that flushes dirty shared buffers to disk, so larger shared_buffers and more dirty pages mean longer shutdown.
Why It MattersFor PostgreSQL instances needing fast restarts, an explicit CHECKPOINT before shutdown shortens downtime; with large UNLOGGED tables you must use FLUSH_UNLOGGED (v19+) or the FILE_COPY database trick, or shutdown stays slow.