I imported a postgres database in my local postgres server. I had to connect to the database (to allows django to retrive data) using the file called setup.local.
There is required to specify: DB_HOST=localhost
, DB_NAME
, DB_USER
, DB_PASSWORD
.
DB_HOST is localhost
without any doubt. The DB_name is the one I choose importing (psql imported_db < downloaded_DB
)
DB_USER is my_name (or I can change the owner ALTER DATABASE imported_db OWNER TO other_name
).
The wire thing, for me, is that I have to use the user (either the my_name or other_name) password and not the database password (even if the variable name is DB_PASSWORD).
So the question: does a psql database have a password or just the roles/users have ones and use them to access the database?
Andrea