Reputation: 2859
I frequently run into the problem of trying to track down all the information such as the host, the user, the password, whether to use ssl, etc. Is there an easy way to retrieve this information from the psql terminal?
host = "localhost"
port = 5432
user = "postgres"
password = "password"
dbname = "database"
I typically create databases with createdb
but I don't know what user or password it is using.
Upvotes: 2
Views: 5755
Reputation: 2859
To find the host, port and user:
psql
to open up terminal to postgres\c database
to connect to database\conninfo
to retrieve info about connection.To reset the password:
psql
to open terminal to postgres\password
to set new password (edited)Upvotes: 5