# 使用 Homebrew, Nix 安装 ephemeralpg

查看 ephemeralpg 的安装路径、可执行文件、元数据以及面向 AI 代理工作流的安全说明。

## 安装

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

其他安装命令:

### macOS

- Homebrew (100%):

```sh
brew install ephemeralpg
```

  证据: local Homebrew formula metadata

### Linux

- Nix (92%):

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

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

## 软件包事实

- **软件包键:** brew:ephemeralpg
- **软件包管理器:** Homebrew
- **软件包管理器页面:** <https://formulae.brew.sh/formula/ephemeralpg>
- **版本:** 3.4
- **来源摘要:** Run tests on an isolated, temporary Postgres database
- **主页:** <https://eradman.com/ephemeralpg/>
- **上游文档:** <https://eradman.com/ephemeralpg/>
- **许可证:** ISC
- **源码归档:** <https://eradman.com/ephemeralpg/code/ephemeralpg-3.4.tar.gz>
- **已生成:** 2026-08-04T22:13:35+00:00

## 可执行文件

- getsocket (cli)
- pg_tmp (cli)
- getsocket (别名)
- pg_tmp (别名)

## 依赖

- libpq

## 安装行为

- post-install 钩子: 未定义
- Bottle: 可用 于 arm64_linux, arm64_sequoia, arm64_sonoma, arm64_tahoe, arm64_ventura, sonoma, ventura, x86_64_linux

## 版本和新鲜度

- 页面生成时间: 2026-08-04
- 管理器版本: 3.4
- 本地数据: OK
- 上游仓库: https://eradman.com/ephemeralpg/
- 信息: No package-manager update timestamp was available.
- 信息: Release/tag comparison is only available for GitHub repositories.
## 项目历史与用法

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.

### 项目历史

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.

### 采用历史

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.

### 使用方式

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.

### 为什么软件包爱好者会关心

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.

### 时间线

- 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.

### 来源

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


## 安全说明

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

- **Geiger 风险:** blue / 中
- broad file, network, media, or database tool signal

## 源数据库详情

- **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

## 其他软件包管理器记录

- 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


## 相关链接

- [Secret-risk packages](https://pkg.so/zh-hans/secret-risk-packages/) - Has protected-tool coverage, approval-gate, or non-low Geiger security signals.
- [Terminal utility packages](https://pkg.so/zh-hans/terminal-utilities/) - Matched terminal and command-line workflow metadata.
- [Text processing packages](https://pkg.so/zh-hans/text-processing-tools/) - Matched text, document, or structured-data processing metadata.
- [Developer build packages](https://pkg.so/zh-hans/developer-build-tools/) - Matched build, compiler, generator, or developer workflow metadata.
- [libpq](https://pkg.so/zh-hans/brew/libpq/) - Runtime dependency declared by Homebrew.
- [pgweb](https://pkg.so/zh-hans/brew/pgweb/) - Shares pkgdb curated category or tags: cli, data, databases, postgresql.
- [pgxnclient](https://pkg.so/zh-hans/brew/pgxnclient/) - Shares pkgdb curated category or tags: cli, data, databases, postgresql.
- [pgsync](https://pkg.so/zh-hans/brew/pgsync/) - Shares pkgdb curated category or tags: cli, data, databases, postgresql.
- [pgstream](https://pkg.so/zh-hans/brew/pgstream/) - Shares pkgdb curated category or tags: cli, data, databases, postgresql.
- [ccm](https://pkg.so/zh-hans/brew/ccm/) - Shares pkgdb curated category or tags: cli, data, databases, testing.
- [pgslice](https://pkg.so/zh-hans/brew/pgslice/) - Shares pkgdb curated category or tags: cli, data, databases, postgresql.
- [prestd](https://pkg.so/zh-hans/brew/prestd/) - Shares pkgdb curated category or tags: cli, data, databases, postgresql.
- [pgtoolkit](https://pkg.so/zh-hans/brew/pgtoolkit/) - Shares pkgdb curated category or tags: cli, data, databases, postgresql.
- [check_postgres](https://pkg.so/zh-hans/brew/check-postgres/) - Local metadata places this package in an adjacent workflow. Shared terms: cli, data, database, databases, libpq.

## Combined YAML source

View the package source record on GitHub. [combined/ephemeralpg.yml](https://github.com/mxcl/pkgdb/blob/main/combined/ephemeralpg.yml)


## 来源

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