Skip to content

Commit 3366600

Browse files
committed
Added binaries
Former-commit-id: db939f4
1 parent 4524cd4 commit 3366600

9 files changed

Lines changed: 28 additions & 15 deletions

File tree

README.md

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,21 @@
11
# pgdiff - PostgreSQL schema diff
22

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.
44

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.
66

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)
88

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).
9+
### download
10+
[osx64](https://github.com/joncrlsn/pgrun/raw/master/bin-osx64/pgdiff "OSX 64-bit version")
11+
[osx32](https://github.com/joncrlsn/pgrun/raw/master/bin-osx32/pgdiff "OSX version")
12+
[linux64](https://github.com/joncrlsn/pgrun/raw/master/bin-linux64/pgdiff "Linux 64-bit version")
13+
[linux32](https://github.com/joncrlsn/pgrun/raw/master/bin-linux32/pgdiff "Linux version")
14+
[win64](https://github.com/joncrlsn/pgrun/raw/master/bin-win64/pgdiff.exe "Windows 64-bit version")
15+
[win32](https://github.com/joncrlsn/pgrun/raw/master/bin-win32/pgdiff.exe "Windows version")
1016

11-
<!-- A couple of binaries to save you the effort: [Mac](https://github.com/joncrlsn/pgdiff/raw/master/bin-osx/pgdiff "OSX version") -->
1217

13-
## usage
18+
### usage
1419

1520
pgdiff [database flags] <schemaType>
1621

@@ -28,4 +33,4 @@ I'm a big fan of GoLang because of how easy it is to deliver a single executable
2833
-p2 | second db port number. defaults to 5432
2934
-d2 | second db name
3035

31-
&lt;schemaType&gt; the type of objects in the schema to compare: ALL, SEQUENCE, TABLE, COLUMN, PRIMARY_KEY, UNIQUE, FOREIGN_KEY (soon: INDEX, ROLE)
36+
&lt;schemaType&gt; the type of objects in the schema to compare: ALL, ROLE, SEQUENCE, TABLE, COLUMN, INDEX, FOREIGN_KEY, OWNER, GRANT_RELATIONSHIP, GRANT_ATTRIBUTE

bin-linux/pgdiff.REMOVED.git-id

Lines changed: 0 additions & 1 deletion
This file was deleted.

bin-linux32/pgdiff.REMOVED.git-id

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
88d256d1e7da5036f2beb0192efd962fdcfbfb38

bin-linux64/pgdiff.REMOVED.git-id

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
76f2d7e67c68d17a28a2c1bf061f240721b3fba1

bin-osx32/pgdiff.REMOVED.git-id

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
9baee363c1164948fa6cfb84e211b549ff05feca

bin-osx64/pgdiff.REMOVED.git-id

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
ee52bdc91b83ecb1e4bb80c1d5fd661334fe41a4
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
ef59005259fca1ef059dceb892cb8057b52f51ae
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
b4eaea7010e13241b292b9be1c2b383c4c08fb8b

pgdiff.sh

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -27,15 +27,18 @@ function rundiff() {
2727
if [[ $x =~ y ]]; then
2828
pgrun -U $USER2 -pw $PASS2 -h $HOST2 -d $NAME2 -o "$OPT2" -f "${TYPE}.sql"
2929
fi
30+
echo
3031
}
3132

32-
#rundiff ROLE
33-
#rundiff SEQUENCE
34-
#rundiff TABLE
35-
#rundiff COLUMN
36-
#rundiff INDEX
37-
#rundiff FOREIGN_KEY
38-
#rundiff OWNER
33+
rundiff ROLE
34+
rundiff SEQUENCE
35+
rundiff TABLE
36+
rundiff OWNER
37+
rundiff COLUMN
38+
rundiff INDEX
39+
rundiff FOREIGN_KEY
3940
rundiff GRANT_RELATIONSHIP
4041
rundiff GRANT_ATTRIBUTE
4142

43+
echo "Done!"
44+

0 commit comments

Comments
 (0)