You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+12-7Lines changed: 12 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,16 +1,21 @@
1
1
# pgdiff - PostgreSQL schema diff
2
2
3
-
Please note that this program never modifies any database directly, and you are solely responsible for verifying the generated SQL *before* running it against your database. Now that you know about that, it should give you confidence that it is safe to try out and see what SQL gets generated.
3
+
An important feature of this utility is that it never modifies any database directly. You are solely responsible for verifying the generated SQL *before* running it against your database. Now that you know about that, it should give you confidence that it is safe to try out and see what SQL gets generated.
4
4
5
-
Written in GoLang, this utility compares the schema between two PostgreSQL databases and generates alter statements to be *manually* run against the second database. Not everything in the schema is compared, but the things considered important (at the moment) are: sequences, tables, columns (and their default values), primary keys, unique constraints, foreign keys... and soon indexes and user roles.
5
+
Written in GoLang, pgdiff compares the schema between two PostgreSQL databases and generates alter statements to be *manually* run against the second database. At the moment, not everything in the schema is compared, but the things considered important are: roles, sequences, tables, columns (and their default values), primary keys, unique constraints, foreign keys, roles, ownership information, and grants.
6
6
7
-
It is written to be easy to add and improve the accuracy of the diff. Please let me know if you think this goal has not been met. I'm very interested in suggestions and contributions to improve this program. I'm not a GoLang expert yet, but each program I write gets me closer to that goal.
7
+
It is written to be easy to add and improve the accuracy of the diff. If you find something that seems wrong and you want me to look at it, please send me two schema-only database dumps that I can test with (Use the --schema-only option with pg\_dump)
8
8
9
-
I'm a big fan of GoLang because of how easy it is to deliver a single executable on almost any platform. But, just as important I love the design choices and the concurrency features which I've only begun to delve into. For example, streaming objects back (via a channel) from a go routine is far better than returning a potentially massive list of objects (as you are forced to do with most languages... or implement paging).
<!-- A couple of binaries to save you the effort: [Mac](https://github.com/joncrlsn/pgdiff/raw/master/bin-osx/pgdiff "OSX version") -->
12
17
13
-
## usage
18
+
###usage
14
19
15
20
pgdiff [database flags] <schemaType>
16
21
@@ -28,4 +33,4 @@ I'm a big fan of GoLang because of how easy it is to deliver a single executable
28
33
-p2 | second db port number. defaults to 5432
29
34
-d2 | second db name
30
35
31
-
<schemaType> the type of objects in the schema to compare: ALL, SEQUENCE, TABLE, COLUMN, PRIMARY_KEY, UNIQUE, FOREIGN_KEY (soon: INDEX, ROLE)
36
+
<schemaType> the type of objects in the schema to compare: ALL, ROLE, SEQUENCE, TABLE, COLUMN, INDEX, FOREIGN_KEY, OWNER, GRANT_RELATIONSHIP, GRANT_ATTRIBUTE
0 commit comments