PostgreSQL schema comparison and diff tool

dbForge Schema Compare is a free tool for easy and effective comparison and synchronization of database structures across PostgreSQL, Amazon Redshift, Amazon RDS for PostgreSQL, and Azure PostgreSQL.

  • Find differences in PostgreSQL and related databases quickly and efficiently
  • Compare Amazon Redshift database structures and fix discrepancies
  • Generate SQL scripts to synchronize a source database with a target one
  • Apply updates from development to staging or production
  • Migrate PostgreSQL schemas to Amazon Redshift
  • Automate synchronization tasks from the command line

Supported databases

You can use the following databases as sources and targets for schema comparison and synchronization:

  • Amazon Redshift
  • PostgreSQL databases (limited support)*
  • Amazon RDS for PostgreSQL (limited support)*
  • Azure PostgreSQL (limited support)*

*The integrated Schema Compare in dbForge Studio for PostgreSQL removes this limitation.

Supported schema objects

This tool compares and synchronizes the following objects:

  • Schemas
  • Tables
  • Views
  • Materialized views
  • Triggers
  • Functions
  • Procedures
  • Sequences
  • Table-valued functions

Non-schema object comparison

Along with database schema objects, dbForge Schema Compare for PostgreSQL compares and synchronizes per-object security permissions and firing modes for triggers.

Analysis of comparison results

Comparison results are presented in comprehensive documents where you can do the following:

Synchronization

dbForge Schema Compare provides the following synchronization features:

Integrated SQL Editor

For extra convenience, you can write and run queries in dbForge Schema Compare using an integrated SQL Editor.

  • Context-aware code completion and formatting
  • Quick object information
  • Execution of the current statement
  • Execution of large scripts
  • Operations with data in the grid (viewing, sorting, grouping, filtering, and editing)
  • Grid View and Card View modes
  • Paginated mode for displaying a large number of records
  • Auto-search mode for column data

Frequently asked questions

What is a PostgreSQL schema comparison tool?

A PostgreSQL schema comparison tool compares the database structures of two PostgreSQL databases and shows the differences. For instance, it can compare the following:

  • Tables
  • Columns
  • Indexes
  • Constraints
  • Views and materialized views
  • Functions
  • Procedures
  • Triggers
  • Sequences
  • Permissions

A common distinction is that schema comparison is all about database structure, whereas comparing the actual data in two databases is a different task.

How can I compare two PostgreSQL schemas?

You will need a specialized tool for this task. It may be a command-line tool that dumps schema definitions for comparison, or a dedicated schema diff utility with a convenient GUI. For instance, the free dbForge Schema Compare for PostgreSQL (or its much more powerful counterpart dbForge Studio for PostgreSQL) offer flexible comparison and synchronization wizards that make the entire experience smooth and easy for beginners and experts alike.

What is the difference between schema comparison and schema diff?

The terms are closely related, but they usually imply slightly different things:

  • Schema comparison is the process of examining two schemas to identify how they differ.
  • Schema diff is the result of that comparison—the specific changes between the schemas.

In practice, however, the terms are often used interchangeably to refer to a schema comparison tool.

Can I generate a PostgreSQL schema synchronization script?

You can do it with a proper tool at hand. dbForge Schema Compare and dbForge Studio both offer auto-generated schema synchronization scripts that can be reviewed, saved, and/or executed against the target database.

Does dbForge Schema Compare find differences in table data?

No. Schema and data comparison are different tasks that require different tools. To compare table data in PostgreSQL, you can use dbForge Data Compare.

Can I compare PostgreSQL and Amazon Redshift schemas?

Yes, you can easily compare and sync PostgreSQL and Amazon Redshift schemas using dbForge Schema Compare or dbForge Studio for PostgreSQL.

What PostgreSQL objects can be compared and synchronized?

Using dbForge Schema Compare, you can compare and synchronize the following objects:

  • Schemas
  • Tables
  • Views
  • Materialized views
  • Triggers
  • Functions
  • Procedures
  • Sequences
  • Table-valued functions