# Install ephemeralpg with Homebrew, Nix

Run tests on an isolated, temporary Postgres database. Version 3.4 via Homebrew; verified from local package data.

## Install

```sh
sudo av install brew:ephemeralpg
```

Additional install commands:

### macOS

- Homebrew (100%):

```sh
brew install ephemeralpg
```

  Evidence: local Homebrew formula metadata

### Linux

- Nix (92%):

```sh
nix profile install nixpkgs#ephemeralpg
```

  Evidence: nixpkgs package indexes: pkgs/by-name/ep/ephemeralpg/package.nix from https://api.github.com/repos/NixOS/nixpkgs/git/trees/master?recursive=1

## Package facts

- **Package key:** brew:ephemeralpg
- **Package manager:** Homebrew
- **Package manager page:** <https://formulae.brew.sh/formula/ephemeralpg>
- **Version:** 3.4
- **Source summary:** Run tests on an isolated, temporary Postgres database
- **Homepage:** <https://eradman.com/ephemeralpg/>
- **Repository:** <https://github.com/eradman/ephemeralpg>
- **Upstream docs:** <https://eradman.com/ephemeralpg>
- **License:** ISC
- **Source archive:** <https://eradman.com/ephemeralpg/code/ephemeralpg-3.4.tar.gz>
- **Generated:** 2026-07-08T07:18:31+00:00

## Executables

- getsocket (cli)
- pg_tmp (cli)
- getsocket (alias)
- pg_tmp (alias)

## Dependencies

- libpq

## Install behavior

- Post-install hook: not defined
- Bottle: available on arm64_linux, arm64_sequoia, arm64_sonoma, arm64_tahoe, arm64_ventura, sonoma, ventura, x86_64_linux

## Freshness

- Page generated: 2026-07-08
- Package-manager version: 3.4
- Local data: ok
- Upstream repository: https://eradman.com/ephemeralpg/
- info: No package-manager update timestamp was available.
- info: Release/tag comparison is only available for GitHub repositories.
## Project history and usage

Ephemeral PostgreSQL is a compact test utility centered on `pg_tmp`, a shell script that starts isolated temporary PostgreSQL databases. It gives test suites a real PostgreSQL server without making developers keep a long-lived database around or substitute SQLite for PostgreSQL behavior.

### Project history

The NEWS file records version 1.0 on January 7, 2015 as an initial Bitbucket release and describes it as a cross-platform implementation in fewer than one hundred lines of code. Later releases added TCP binding through the bundled `getsocket` utility, better cleanup behavior, PostgreSQL-version compatibility fixes, extra server options, and a test framework.

The project moved hosting from Bitbucket to GitHub in version 2.8 on September 25, 2019. Its public project page was still maintained in 2025 and documents `pg_tmp` as a compact shell script for unit and integration testing with PostgreSQL in any language.

### Adoption history

ephemeralpg is not a mass-market database package, but it has a clear testing niche: teams that need PostgreSQL-specific behavior in tests without shared state. Homebrew and Nix packaging make the tool easy to install in developer workstations and CI images.

### How it is used

A common workflow is `uri=$(pg_tmp)` followed by running `psql` or an application test suite against that connection URI. The tool can start a database on a random TCP port, keep it alive for a specified window, pass server options such as disabling autovacuum, and garbage-collect temporary databases automatically.

The project page explains several performance techniques: avoiding fully sequential init/start/stop work, disabling runtime fsync, spinning for the first connection, pre-initializing a background database under `/tmp`, and shutting down asynchronously.

### Why package nerds care

ephemeralpg is interesting because it solves a common developer-tools problem with shell and standard PostgreSQL tools instead of a service daemon. It is small, inspectable, and very package-manager-friendly: install it, call `pg_tmp`, and get a disposable database URI.

### Timeline

- 2015-01-07: Version 1.0 initially released on Bitbucket.
- 2015-12-12: Version 1.7 added a more extensive `make test` framework.
- 2016-03-29: Version 2.0 allowed temporary directories with initdb/start/stop arguments.
- 2019-09-25: Version 2.8 moved hosting from Bitbucket to GitHub.
- 2025-02-06: Version 3.4 adjusted startup behavior and Mac OS locale handling.

### Related projects

- ephemeralpg depends on the standard PostgreSQL toolchain, especially `initdb`, `pg_ctl`, `postgres`, and `psql`, and includes helper utilities such as `getsocket` plus optional contrib scripts.

### Sources

- <https://eradman.com/ephemeralpg/>
- <https://github.com/eradman/ephemeralpg>
- <https://raw.githubusercontent.com/eradman/ephemeralpg/master/NEWS>


## Security Notes

broad file, network, media, or database tool signal.

- **Geiger risk:** blue / medium
- broad file, network, media, or database tool signal

## Source Database Details

- **Source Database:** Homebrew formula API
- **Tap:** homebrew/core
- **Full Name:** ephemeralpg
- **Version Scheme:** 0
- **Revision:** 0
- **Bottle Stable Root URL:** <https://ghcr.io/v2/homebrew/core>
- **Deprecated:** no
- **Disabled:** no
- **Keg Only:** no
- **URL Keys:** stable

## Other Package-Manager Records

- Nix - ephemeralpg: normalized package name match | nixpkgs package indexes: pkgs/by-name/ep/ephemeralpg/package.nix from https://api.github.com/repos/NixOS/nixpkgs/git/trees/master?recursive=1


## Related links

- [Secret-risk packages](https://www.automicvault.com/pkg/secret-risk-packages/) - Has protected-tool coverage, approval-gate, or non-low Geiger security signals.
- [Terminal utility packages](https://www.automicvault.com/pkg/terminal-utilities/) - Matched terminal and command-line workflow metadata.
- [Text processing packages](https://www.automicvault.com/pkg/text-processing-tools/) - Matched text, document, or structured-data processing metadata.
- [Developer build packages](https://www.automicvault.com/pkg/developer-build-tools/) - Matched build, compiler, generator, or developer workflow metadata.
- [libpq](https://www.automicvault.com/pkg/brew/libpq/) - Runtime dependency declared by Homebrew.
- [check_postgres](https://www.automicvault.com/pkg/brew/check-postgres/) - Shares av.db curated category or tags: cli, data, databases, postgresql.
- [pgslice](https://www.automicvault.com/pkg/brew/pgslice/) - Shares av.db curated category or tags: cli, data, databases, postgresql.
- [pgstream](https://www.automicvault.com/pkg/brew/pgstream/) - Shares av.db curated category or tags: cli, data, databases, postgresql.
- [pgsync](https://www.automicvault.com/pkg/brew/pgsync/) - Shares av.db curated category or tags: cli, data, databases, postgresql.
- [pgtoolkit](https://www.automicvault.com/pkg/brew/pgtoolkit/) - Shares av.db curated category or tags: cli, data, databases, postgresql.
- [pgweb](https://www.automicvault.com/pkg/brew/pgweb/) - Shares av.db curated category or tags: cli, data, databases, postgresql.
- [pgxnclient](https://www.automicvault.com/pkg/brew/pgxnclient/) - Shares av.db curated category or tags: cli, data, databases, postgresql.
- [prestd](https://www.automicvault.com/pkg/brew/prestd/) - Shares av.db curated category or tags: cli, data, databases, postgresql.

## Combined YAML source

View the package source record on GitHub. [combined/ephemeralpg.yml](https://github.com/automic-vault/db/blob/main/combined/ephemeralpg.yml)


## Sources

- Nucleus package database
- Geiger risk classifier
- package-page enrichment
- curated package history
- package version freshness
- av.db category and tag curation
- package relationship graph
- external package-manager database matches
- cross-ecosystem install command graph
