Built for How PostgreSQL
Developers Actually Work
Stop fighting your migration tool. Start shipping database changes with the confidence and speed of modern software development.
The PostgreSQL Development Problem
Current migration tools weren't built for PostgreSQL's advanced features and complex dependencies.
Dependency Hell Stops Development Cold
Change one function → break three views → spend 2 hours manually fixing dependencies → repeat for every change.
pgmt Handles Dependencies Automatically
Edit schema files like code. pgmt figures out the dependency chain and applies changes in the correct order.
-- Just edit the function in your schema file
-- schema/functions/calculate_score.sql
CREATE OR REPLACE FUNCTION calculate_score(user_id INTEGER)
RETURNS INTEGER AS $$
-- Your updated logic here
RETURN (SELECT points * 2 FROM user_activities WHERE id = user_id);
$$ LANGUAGE plpgsql;# Apply instantly to development
$ pgmt apply
✓ Dropping view analytics_summary
✓ Dropping view daily_stats
✓ Dropping view user_rankings
✓ Updating function calculate_score
✓ Recreating view user_rankings
✓ Recreating view daily_stats
✓ Recreating view analytics_summary
✓ Done.Why Current Tools Fall Short
Generic Database Tools (Flyway, Liquibase)
- • Treat PostgreSQL like MySQL - miss advanced features
- • No dependency resolution for views and functions
- • Migration-first workflow slows development
- • Production failures from untested complex changes
ORM Migrations (Prisma, ActiveRecord)
- • Limited to basic table operations
- • Can't handle PostgreSQL functions, triggers, views
- • Magic auto-generation hides what's actually happening
- • Lock you out of PostgreSQL's powerful features
Raw SQL Scripts
- • Full PostgreSQL power but zero safety net
- • Manual dependency management (error-prone)
- • No development workflow - straight to production
- • Team collaboration nightmares
pgmt: The PostgreSQL-Native Solution
- • Full PostgreSQL feature support
- • Automatic smart dependency resolution
- • Instant development feedback
- • Explicit production control with review
Development Workflow Comparison
See how pgmt transforms the PostgreSQL development experience from start to finish.
Traditional Way
pgmt Way
Full PostgreSQL Support
Everything other tools ignore. pgmt handles the full range of PostgreSQL objects.
Production-Ready Migrations
Break complex migrations into retryable sections with individual timeouts and transaction controls.
-- migrations/V001__user_migration.sql
-- pgmt:section name="schema_changes"
-- pgmt: mode="transactional"
-- pgmt: timeout="5s"
ALTER TABLE users ADD COLUMN last_login TIMESTAMPTZ;
-- pgmt:section name="add_index"
-- pgmt: mode="non-transactional"
-- pgmt: timeout="5m"
CREATE INDEX CONCURRENTLY idx_users_last_login ON users(last_login);
-- pgmt:section name="backfill_data"
-- pgmt: mode="transactional"
-- pgmt: timeout="30s"
UPDATE users SET last_login = created_at WHERE last_login IS NULL;Get Started in Minutes
Works with any existing PostgreSQL database. No complex migration required.
From Zero to Schema-as-Code
# Install pgmt
$ cargo install pgmt
# Initialize in your project
$ pgmt init
✓ Created schema/ directory
✓ Created pgmt.yaml configuration
# Start developing - edit schema files, then:
$ pgmt apply
✓ Schema applied to development database
# When ready for production:
$ pgmt migrate new "add user preferences"
✓ Generated migration: V20240315__add_user_preferences.sqlThe Bottom Line
pgmt is the only tool that gives you PostgreSQL's full power with instant development feedback and production-grade safety .