owocki / pytrader

cryptocurrency trading robot
MIT License
1.94k stars 429 forks source link

Fix docker wait-and-run.sh when POSTGRES_USER is different from POSTGRES_DB #66

Closed igorpejic closed 8 years ago

igorpejic commented 8 years ago

When the postgres_user and postgres_db are different this causes a bug:

For example: POSTGRES_USER=igor POSTGRES_DB=trader

result: FATAL: database "igor" does not exist

Explanation of solution:

http://www.postgresql.org/message-id/1155685965.28246.6.camel@dell.home.lan

If you run psql without a database name as an option, it tries to connect to a database with the same name as the $USER psql runs as.

t0mk commented 8 years ago

Looks good.

Snipa22 commented 8 years ago

Looks good to me. We'll probally want to update the importer as well, as it uses the db as well.

owocki commented 8 years ago

:+1: