{"repo":"joncrlsn/pgdiff","free":true,"listed":false,"github":"https://github.com/joncrlsn/pgdiff","clone":"git clone https://github.com/joncrlsn/pgdiff.git","description":"Compares the PostgreSQL schema between two databases and generates SQL statements that can be run manually against the second database to make their schemas match.","language":"Go","stars":506,"topics":["sql-generation","database","go","postgresql-database","diff","diffing"],"license":"MIT","category":"databases-storage","readme_excerpt":"pgdiff - PostgreSQL schema diff pgdiff compares the schema between two PostgreSQL 9 databases and generates alter statements to be manually run against the second database to make them match. The provided pgdiff.sh script helps automate the process. pgdiff is transparent in what it does, so it never modifies a database directly. You alone are responsible for verifying the generated SQL before running it against your database. Go ahead and see what SQL gets generated. pgdiff is written to be easy to expand and improve the accuracy of the diff. download 1.0 beta 1 osx &nbsp; linux &nbsp; windows usage pgdiff [options] (where options and &lt;schemaType&gt; are listed below) There seems to be an ideal order for running the different schema types. This order should minimize the problems you encounter. For example, you will always want to add new tables before you add new columns. In addition, some types can have dependencies which are not in the right order. A classic case is views which depend on other views. The missing view SQL is generated in alphabetical order so if a view create fails due to a missing view, just run the views SQL file over again. The pgdiff.sh script will prompt you about running it again. Schema type ordering: 1. SCHEMA 1. ROLE 1. SEQUENCE 1. TABLE 1. COLUMN 1. INDEX 1. VIEW 1. FOREIGN\\ KEY 1. FUNCTION 1. TRIGGER 1. OWNER 1. GRANT\\ RELATIONSHIP 1. GRANT\\ ATTRIBUTE 1. ALL (all above in one run) example I have found it helpful to take dumps of the databases i","default_branch":null,"files":null,"tree":[],"storefront":"/r/joncrlsn","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/joncrlsn/pgdiff/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}