Skip to main content

Posts

Showing posts from July, 2017

[psql] Command Equivalents in Postgres Coming From Mysql

Mysql Postgres Description  mysqldump  pg_dumpall  pg_dumpall is designed to dump all of the databases and calls pg_dump to do it. It can also be used to dump global values like roles and tablespaces.Example with mysql: mysqldump –all-databases > /path/to/file.sql Example with postgres: pg_dumpall > /path/to/file.sql mysqldump pg_dump pg_dump is used for dumping individual databases.Example with mysql: mysqldump mydatabase > /path/to/file.sql Example with postgres: pg_dump mydatabase > /path/to/file.sql n/a pg_restore pg_dump is capable of dumping to multiple formats with the -F option.  The default option is as a raw sql file.  If you wanted to dump as postgres’s “custom” format, you could add -Fc as options before the database name when using pg_dump.pg_restore is designed to restore from output files generated in this fashion. I am not aware of a mysql equivalent for pg_restore, but it reminds me more of a restore of a binary type file t...

[git] My global config

Add to .gitconfig [user]         name = Name         email = Email [alias]         hist1 = log --all --graph --pretty=format:'%C(auto)%h%C(auto)%d %s %C(dim white)(%aN, %ar)'         hist2 = log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit