PostgreSQL Schema CompareCompare a live PostgreSQL database with local SQL files, review the differences, and sync either side from Visual Studio Code. Workflows1. Configure, explore, and write schema filesChoose a schema folder, enter and test your PostgreSQL connection, then save the settings. Browse schemas and objects in Database Objects and select Write Database to Folder to create local SQL files.
2. Compare, review a migration plan, and updateOpen Schema Folder vs Database to inspect differences. Compare an object, preview its migration SQL, or update the folder or live database.
Quick start
The folder picker starts in your home directory. You can navigate to any folder; choosing another folder replaces the saved schema folder path. What you can do
The comparison view filters by schema, object type, and status. Its bulk actions apply to the differences currently shown by those filters. Each row has its own Compare, Migration Plan, Update Folder, and Update Database actions where applicable. After an update, completed rows are removed and affected explorer folders refresh. Compare an individual object
Tables use a table-aware comparison, so changing only the order of columns does not create a difference. Browse and manage the connectionDatabase Objects groups tables, views, materialized views, indexes, functions, procedures, sequences, triggers, and types by schema. Open a schema and object folder to load comparison results. Object folders show Right-click the database connection and choose Remove Connection to disconnect and clear its saved host, database, username, and password without a prompt. The port resets to You can also refresh the view or individual object folders from the live database. Reveal in File Explorer opens the matching local folder for a connection, schema, object folder, or object. Migration plans and update directionUpdate Folder uses the database definition as the source and changes local files. Update Database uses local files as the source and changes the live database. Review the generated SQL before applying a database update. For modified tables, the standard plan uses For a modified table, a separate Drop and Recreate Table plan is available. It removes table rows and may lose database properties or dependent objects that are absent from local SQL. PostgreSQL can also block the drop when other objects depend on the table. Preview this plan before using its Update Database action; the extension asks for data-loss confirmation. Combined plans create schemas and prerequisite types and sequences before tables and deferred foreign keys where practical. Modified non-table objects use supported drop-and-create plans. The header menu can generate a plan or update all currently visible actionable differences, including the table recreation variant when relevant. Local folder layoutThe preferred structure is one folder per PostgreSQL schema, then one folder per object type:
Set ConfigurationOpen Configure Connection from the extension sidebar. Settings are saved in the current workspace when one is open, or in user settings otherwise.
Requirements
Development
Use |

