windows-7 - pgAgent无法连接数据库:'fe_sendauth: no password supplied'( 在Windows7中)


[Environment ]

DB : PostgreSQL 9.3

OS : Window 7

OS login ID :

pgAdmin login ID : postgres

pgAgent user : postgres 

pgAgent schema belongs to: postgres DB

DB that I'll treat : testDB (In Step configuration, I specified 'testDB' as Database.
 Connection type is 'local'. Connection string is empty.)

DB server : local machine (my laptop computer)


输出消息(pgAdmin >统计信息)

[Warning] Couldn't get a connection to the database (pgAgent)


Failed to create new connection to database 'testDB':'fe_sendauth: no password supplied'


localhost:5432:postgres:postgres:[pgAdmin password for postgres]
localhost:5432:testDB:postgres:[pgAdmin password for postgres]


@remove-line-for-nolocal@#"local" is for Unix domain socket connections only

@remove-line-for-nolocal@local all all @authmethodlocal@
# IPv4 local connections:
host all all trust
# IPv6 local connections:
host all all ::1/128 @authmethodhost@
# Allow replication connections from localhost, by a user with the
# replication privilege.
@remove-line-for-nolocal@#local replication @default_username@ @authmethodlocal@
#host replication @default_username@ @authmethodhost@
#host replication @default_username@ ::1/128 @authmethodhost@


C:Program Files (x86)pgAgentbinpgagent.exe RUN pgAgent host=localhost port=5432 user=postgres dbname=postgres

pgAgent服务登录ID (服务>pgAgent>属性>登录选项卡)

id :

pwd : ['s password ]


[Solution ]

I made other OS login ID. (NOT need to be 'postgres' !!)
And put pgpass.conf in that ID's AppDataRoamingpostgresql

[Reason ]

pgAgent could not find pgpass.conf in login ID's directory.


login ID : anyname

real name : anyname ( C:Usersanyname )