pgadmin4
pgadmin4 copied to clipboard
pgAgent Job issue: Couldn't get a connection to the database when local SQL mode specified in another database other than postgres
Please note that security bugs or issues should be reported to [email protected].
Describe the bug
pgAgent Job issue: Couldn't get a connection to the database when local SQL mode specified in another database other than postgres To Reproduce
Step to reproduce:
- Create a job (local/SQL)
- Select another database other than default postgres
- Create SQL scripts & scheduler task
- Run the job
Expected behavior The jobstep log should show corresponding result, e.g. s.
Error message The jobstep have a information with status:r and error message: Couldn't get a connection to the database
Screenshots
Desktop (please complete the following information):
- OS:Windows Server 2019
- Version:Windows Server 2019
- Mode: Server
- Browser (if running in server mode): [e.g. chrome, safari]
- Package type: [e.g. RPM, DEB, Python, Container, etc.]
Additional context
When I switch the database back to default postgres, the job runs succesfully without any problem.
@rdczhzq
Find your %AppData%\Roaming\postgresql\pgpass.conf file under the user whose credentials you have provided for the pgAgent installer. For my computer, it's C:\Users\enterprisedb\AppData\Roaming\postgresql\pgpass.conf
Change the line localhost:5444:edb:enterprisedb:edb to localhost:5444:*:enterprisedb:edb (Format: HOST:PORT:DATABASE:USER:PASSWORD)
Hi Akshay
It works after replace with *.
Will you include this into the end of May release?
Best regards, Joe
@.***
From: Akshay Joshi Date: 2024-05-16 21:17 To: pgadmin-org/pgadmin4 CC: Joe; Mention Subject: Re: [pgadmin-org/pgadmin4] pgAgent Job issue: Couldn't get a connection to the database when local SQL mode specified in another database other than postgres (Issue #7478) @rdczhzq Find your %AppData%\Roaming\postgresql\pgpass.conf file under the user whose credentials you have provided for the pgAgent installer. For my computer, it's C:\Users\enterprisedb\AppData\Roaming\postgresql\pgpass.conf Change the line localhost:5444:edb:enterprisedb:edb to localhost:5444::enterprisedb:edb (Format: HOST:PORT:DATABASE:USER:PASSWORD) Solution.png (view on web) — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you were mentioned.Message ID: @.**>
@rdczhzq
This is not an issue with pgAgent; it is related to PostgreSQL's behavior in providing the correct entry in the pgpass.conf file
Hence closing this issue.
Will you transfer the ticket to PostgreSQL or shall I open one on PostSQL ? how to proceed?
Best regards Joe
@.***
From: Akshay Joshi Date: 2024-05-17 13:58 To: pgadmin-org/pgadmin4 CC: Joe; Mention Subject: Re: [pgadmin-org/pgadmin4] pgAgent Job issue: Couldn't get a connection to the database when local SQL mode specified in another database other than postgres (Issue #7478) @rdczhzq This is not an issue with pgAgent; it is related to PostgreSQL's behavior in providing the correct entry in the pgpass.conf file Hence closing this issue. — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you were mentioned.Message ID: @.***>
This is not a bug in PostgreSQL either. Check
So who should be blamed in this case? Who is responsible for populating this file correctly during installation?
Best regards, Joe
@.***
From: Akshay Joshi Date: 2024-05-17 14:11 To: pgadmin-org/pgadmin4 CC: Joe; Mention Subject: Re: [pgadmin-org/pgadmin4] pgAgent Job issue: Couldn't get a connection to the database when local SQL mode specified in another database other than postgres (Issue #7478) This is not a bug in PostgreSQL either. Check — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you were mentioned.Message ID: @.***>
@rdczhzq
Why you would like to blame anyone? This is a process defined by PostgreSQL. The pgpass.conf file should be modified by the administrator who has installed the database server or owns that machine.
It is similar to "pg_hba.conf" where it's the user's responsibility to change as per his/her requirement.
Hi Akshay
In our culture, blame=be responsible for . Now I got it. The DBA for postgres should be responsible for populating this data correct.
Best regards, Joe
@.***
From: Akshay Joshi Date: 2024-05-17 14:34 To: pgadmin-org/pgadmin4 CC: Joe; Mention Subject: Re: [pgadmin-org/pgadmin4] pgAgent Job issue: Couldn't get a connection to the database when local SQL mode specified in another database other than postgres (Issue #7478) @rdczhzq Why you would like to blame anyone? This is a process defined by PostgreSQL. The pgpass.conf file should be modified by the administrator who has installed the database server or owns that machine. It is similar to "pg_hba.conf" where it's the user's responsibility to change as per his/her requirement. — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you were mentioned.Message ID: @.***>