--- title: "temp-postgres 0.4.0" description: "A major UX upgrade for the temporary PostgreSQL server." published: 2026-04-30 --- [temp-postgres](https://git.skreutz.com/temp-postgres.git/) is a small utility to run the PostgreSQL server off a temporary directory. It's been almost six years since the [initial release](/posts/temporary-postgresql-server). The new version completes a major upgrade in terms of user experience and implementation: * Rewritten in async Rust to improve error and signal handling * UNIX-style command wrapper option * Structured logging (also known as tracing) * Graceful shutdown with configurable timeout * Experimental Nix flake support Some examples from the [readme](https://git.skreutz.com/temp-postgres.git/tree/README.md), also available on [crates.io](https://crates.io/crates/temp-postgres-command) and [lib.rs](https://lib.rs/crates/temp-postgres-command): ```sh # Install temp-postgres using Cargo. cargo install temp-postgres-command # Run temp-postgres using Nix. nix run git+https://git.skreutz.com/temp-postgres.git -- --help # Optionally with a fixed PostgreSQL major version. nix run git+https://git.skreutz.com/temp-postgres.git#temp-postgres_18 -- --help # Wrap the psql command for an interactive terminal. No configuration necessary. temp-postgres -- psql # Run SQLx integration tests against a temporary database. temp-postgres -- cargo test # Create a symbolic link to enable static configuration. temp-postgres --symlink db psql --host "$(realpath db)" ``` See the [changelog](https://git.skreutz.com/temp-postgres.git/tree/CHANGELOG.md) for details.