<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/postgres-branches-are-finally-real-cw7cqpahv" -->

---
title: Postgres Branches Are Finally Real | daily.dev
description: A walkthrough of Ghost, a PostgreSQL database forking service that lets developers create isolated database snapshots for AI agents and feature testing without...
canonical: https://daily.dev/posts/postgres-branches-are-finally-real-cw7cqpahv
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: Postgres Branches Are Finally Real | daily.dev
og:description: A walkthrough of Ghost, a PostgreSQL database forking service that lets developers create isolated database snapshots for AI agents and feature testing without...
og:url: https://daily.dev/posts/postgres-branches-are-finally-real-cw7cqpahv
og:image: https://api.daily.dev/og/posts/Cw7CqpAHv.png
og:image:alt: Postgres Branches Are Finally Real
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Postgres Branches Are Finally Real

**[DevOps Toolbox](https://daily.dev/sources/devopstoolbox)** · 11 min read · 3 upvotes · 0 comments

## Summary

A walkthrough of Ghost, a PostgreSQL database forking service that lets developers create isolated database snapshots for AI agents and feature testing without touching production. The video demonstrates the Ghost CLI for creating, forking, querying, and deleting Postgres databases, integrating it with AI coding agents via MCP. It also shows a DIY alternative using Docker, pg_dump, and pg_restore to achieve the same branching workflow locally for free.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://www.youtube.com/watch?v=ex9RpgQMEe4>

## Questions this post answers

### How can I let an AI coding agent modify a database without risking my production data?

Create a forked snapshot of the production database that the agent works against instead of the real one. Tools like Ghost let you run 'ghost fork' to clone a source database into a target copy, connect an agent via MCP to that fork only, and delete it afterward with 'ghost delete', leaving production untouched throughout.

_For workflows balancing AI agent autonomy against data safety, daily.dev surfaces practical database-forking approaches like this._

### How do I fork a Postgres database locally without a paid cloud service?

Run Postgres in a Docker container, then use pg_dump to export the source database and pg_restore to load that dump into a newly created database with a different name. This recreates the same fork-like workflow as commercial services such as Ghost, at no cost beyond local compute, though without automatic scaling, storage management, or a polished CLI.

_Developers weighing managed forking services against a DIY setup can track approaches like this on daily.dev._

## Similar posts on daily.dev

- [Ghost: A Database for Our Times?](https://daily.dev/posts/ghost-a-database-for-our-times--jyjee24ms) · Towards Data Science · 1 upvotes · 0 comments
- [Database Branching in Postgres: Git-Style Workflows with Databricks Lakebase](https://daily.dev/posts/database-branching-in-postgres-git-style-workflows-with-databricks-lakebase-hdnh9bdho) · databricks · 23 upvotes · 0 comments
- [Tiger Data Launches Ghost, a Purpose-Built Database Service for the Agentic Era](https://daily.dev/posts/tiger-data-launches-ghost-a-purpose-built-database-service-for-the-agentic-era-vdnhilhqf) · SD Times · 1 upvotes · 0 comments
- [Branching Without Git Is Now The Default](https://daily.dev/posts/branching-without-git-is-now-the-default-hvk11oomz) · Supabase · 120 upvotes · 6 comments

---

Tags: [#ai-agents](https://daily.dev/tags/ai-agents), [#database](https://daily.dev/tags/database), [#docker](https://daily.dev/tags/docker), [#postgresql](https://daily.dev/tags/postgresql)

[View this post on daily.dev](https://daily.dev/posts/postgres-branches-are-finally-real-cw7cqpahv)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"Postgres Branches Are Finally Real","url":"https://daily.dev/posts/postgres-branches-are-finally-real-cw7cqpahv","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/postgres-branches-are-finally-real-cw7cqpahv"},"datePublished":"2026-07-24T13:49:29.263Z","dateModified":"2026-09-13T20:42:43.394Z","description":"A walkthrough of Ghost, a PostgreSQL database forking service that lets developers create isolated database snapshots for AI agents and feature testing without...","image":"https://i.ytimg.com/vi/ex9RpgQMEe4/sddefault.jpg","thumbnailUrl":"https://i.ytimg.com/vi/ex9RpgQMEe4/sddefault.jpg","isAccessibleForFree":true,"articleSection":"DevOps Toolbox","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"DevOps Toolbox","logo":"https://media.daily.dev/image/upload/s--zlfrGvN5--/f_auto/v1752671176/logos/devopstoolbox","url":"https://daily.dev/sources/devopstoolbox"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/postgres-branches-are-finally-real-cw7cqpahv","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":3},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"ai-agents,docker,postgresql","timeRequired":"PT11M","video":{"@type":"VideoObject","name":"Postgres Branches Are Finally Real","description":"A walkthrough of Ghost, a PostgreSQL database forking service that lets developers create isolated database snapshots for AI agents and feature testing without...","thumbnailUrl":"https://i.ytimg.com/vi/ex9RpgQMEe4/sddefault.jpg","uploadDate":"2026-07-24T13:49:29.263Z","duration":"PT11M","url":"https://api.daily.dev/r/Cw7CqpAHv","embedUrl":"https://www.youtube.com/embed/ex9RpgQMEe4"}}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"DevOps Toolbox","item":"https://daily.dev/sources/devopstoolbox"},{"@type":"ListItem","position":3,"name":"Postgres Branches Are Finally Real"}]}
{"@context":"https://schema.org","@type":"FAQPage","@id":"https://daily.dev/posts/postgres-branches-are-finally-real-cw7cqpahv#faq","mainEntity":[{"@type":"Question","name":"How can I let an AI coding agent modify a database without risking my production data?","acceptedAnswer":{"@type":"Answer","text":"Create a forked snapshot of the production database that the agent works against instead of the real one. Tools like Ghost let you run 'ghost fork' to clone a source database into a target copy, connect an agent via MCP to that fork only, and delete it afterward with 'ghost delete', leaving production untouched throughout. For workflows balancing AI agent autonomy against data safety, daily.dev surfaces practical database-forking approaches like this."}},{"@type":"Question","name":"How do I fork a Postgres database locally without a paid cloud service?","acceptedAnswer":{"@type":"Answer","text":"Run Postgres in a Docker container, then use pg_dump to export the source database and pg_restore to load that dump into a newly created database with a different name. This recreates the same fork-like workflow as commercial services such as Ghost, at no cost beyond local compute, though without automatic scaling, storage management, or a polished CLI. Developers weighing managed forking services against a DIY setup can track approaches like this on daily.dev."}}]}
```

