Reputation: 477
When I login to postgres in Windows cmd using psql
command it by default tries to login to the user name ADMIN
which is my windows user account name, and such user name actually does not exist in the database, I know how to change that by -U
attribute like this psql -U postgres
. I want to login with user name postgres
by default without specifying in the command prompt. like changing any configuration files etc. How do I do that ?
Upvotes: 1
Views: 3252
Reputation: 955
That thread suggests by setting an environment variable:
The PGUSER environment variable is considered when the -U option is not set.
So you may use a batch file essentially doing:
set PGUSER=postgres
psql
Upvotes: 3