Postgres changes to dump and restore database, option port included in all functions

I tried to maintain the same format, adding new functions and a option to use a postgres in a different port (useful when you have different versions of postgres on the same host)
I'm a very noob python developer, please comment if you think we can do it in a different way.