Skip to content
Back to skills

Pgtest Embedded

ASecurity

pgtest.StartEmbedded returns *pgtest.Embedded, which owns the embedded-postgres temp log file it created. Use when Go code calls pgtest.StartEmbedded and keeps the result as *embeddedpostgres.EmbeddedPostgres.

  • 10 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added November 13, 2026
ai-agentsgo

Security analysis

A100/100

Scanned November 13, 2026

npx -y skills add reliant-labs/forge --skill pgtest-embedded --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Pgtest Embedded?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Pgtest Embedded
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/reliant-labs-pgtest-embedded/badge)](https://www.skillsdirectory.com/skills/reliant-labs-pgtest-embedded)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: migration-v1.0.0-pgtest-embedded
description: pgtest.StartEmbedded returns *pgtest.Embedded, which owns the embedded-postgres temp log file it created. Use when Go code calls pgtest.StartEmbedded and keeps the result as *embeddedpostgres.EmbeddedPostgres.
relevance: migration
---

# pgtest.StartEmbedded returns *pgtest.Embedded

Use when Go code calls `pgtest.StartEmbedded` and stores or passes its result
as a `*embeddedpostgres.EmbeddedPostgres`.

## What changed

embedded-postgres creates one `embedded_postgres_log*` temp file per Start in
the shared `os.TempDir()` and reopens it by name on every flush (the end of
Start, and inside Stop). `StartEmbedded` used to delete every such file that
appeared during its own Start, which broke any concurrent instance (another
test process) with `unable to process postgres logs: open …: no such file`.
It now returns `*pgtest.Embedded`, which owns exactly the log file its own
Start created.

## What to do

- `ep, err := pgtest.StartEmbedded(cfg)` still compiles; only a declared type
  changes: `*embeddedpostgres.EmbeddedPostgres` becomes `*pgtest.Embedded`
  (`Stop() error` is unchanged and now also removes the log, after the
  library's final flush).
- If the server outlives your handle (stopped later by `pg_ctl`, or by another
  process), call `ep.Detach()` after a successful Start so the log is not
  leaked. The running postmaster is unaffected.
- No codemod: the change is a type at a call site and whether the server
  outlives the handle is a decision about your lifecycle.

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.