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

# Introduction

> Declarative schema migration for Postgres

![](https://mintcdn.com/pgschema/0WkBUT0FtHZnmbRN/logo/light.png?fit=max\&auto=format\&n=0WkBUT0FtHZnmbRN\&q=85\&s=6c255c2bdd005e854bf235c5f89a1384)

## What is pgschema?

`pgschema` is a CLI tool that brings terraform-style declarative schema migration workflow to Postgres:

* **Dump** a Postgres schema in a developer-friendly format with support for all common objects
* **Edit** a schema to the desired state
* **Plan** a schema migration by comparing desired state with current database state
* **Apply** a schema migration with concurrent change detection, transaction-adaptive execution, and lock timeout control

Think of it as Terraform for your Postgres schemas - declare your desired state, generate plan, preview changes, and apply them with confidence.

Watch in action:

[pgschema workflow demo](https://asciinema.org/a/vXHygDMUkGYsF6nmz2h0ONEQC/iframe?fit=width\&autoplay=0)

## Why pgschema?

Traditional database migration tools often require you to write migrations manually or rely on ORMs that may not support all Postgres features. pgschema takes a different approach:

* **Declarative**: Define your desired schema state in SQL files
* **Schema-based**: Compare at the schema level instead of the database level to reconcile schemas across different tenants
* **Comprehensive**: Support most common Postgres objects under a schema
* **Transparent**: Show exactly what SQL will be executed before applying changes

## Getting Started

> [card] [Installation](https://www.pgschema.com/installation.md)
>
> Install pgschema using Go or download pre-built binaries

> [card] [Quickstart](https://www.pgschema.com/quickstart.md)
>
> Learn the basics with a hands-on tutorial


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.