Forum Discussion
Power BI Postgres connection issues (credentials/invalid certification)
Hello,
Thank you for answering. I manage to 'fix' the "remote certificate is invalid" with unticking the 'encrypt connection' box.
Power BI keeps throwing credentials issues, I cleared permissions, restarted everything so many times, tried on different devices - still the same. I can connect to that database with many other tools (pgAdmin, Datagrip, Metabase) - all work fine. It's clearly not a credential issue. What else can I do please?
Hi koralka ,
Please try below things to fix the issue.
1. Sometimes Power BI fails to resolve the server correctly unless the port is explicitly specified. Try using the below thing in the server field when connecting.
your-db-hostname:5432
2. Check the PostgreSQL server allows connections from your IP and uses the correct authentication method.
host all all 0.0.0.0/0 md5
Note: If you are using SSL, change md5 to scram-sha-256 or cert as needed. And then restart PostgreSQL after editing this file.
3. Power BI uses the Npgsql .NET driver to connect to PostgreSQL. If it's outdated or misconfigured. Download Npgsql v4.0.17 latest supported by Power BI. During installation, check "GAC Installation" to ensure it's registered system-wide.
4. If native connector fails, use an ODBC connection. Install PostgreSQL ODBC driver.
Set up a DSN and connect via Power BI using ODBC instead of the native PostgreSQL connector. This bypasses some of the native connectors.
5. If other databases work but this one doesn’t, Check if the user role has access to the specific database. Check the user has CONNECT privileges on the database.
GRANT CONNECT ON DATABASE your_db TO your_user;
6. Check you are using the latest Power BI Desktop. Older versions may have compatibility issues with newer PostgreSQL setups or Npgsql versions.
7. Enable Logging in Power BI to get more insight. Enable diagnostic logging in Power BI Desktop.
File --> Options --> Diagnostics --> Enable tracing
Check logs in below path.
C:\Users\<YourUser>\AppData\Local\Microsoft\Power BI Desktop\AnalysisServicesWorkspaces
I hope this information helps. Please do let us know if you have any further queries.
Regards,
Dinesh
- v-dineshya10 months agoCommunity Support
Hi koralka ,
We haven’t heard from you on the last response and was just checking back to see if you have a resolution yet. And, if you have any further query do let us know.
Regards,
Dinesh
- koralka10 months agoHelper I
Hello,
Thank you for checking in me. So - there were a few issues - turned out that the infastructure had SSL turned on on the database side - hence the certificate issue.
I have to be on VPN to connect to the DB - I managed to publish the ready to use model to power BI Service but now I can't connect to the database from there. I assume it's to do with privacy setting on the DB's side again. What would be the best option here? To use a gateway?
Thank you so much for your help- Anonymous10 months agoNot applicable
Hi koralka,
Thanks for your response.
I am also a member of the CST team and I recommend raising a support ticket so our support team can assist you directly.
Please refer to the following link for instructions on how to create a support ticket:How to create a Fabric and Power BI Support ticket - Power BI | Microsoft Learn
We appreciate your engagement and thank you for being an active part of the community.
Best regards,
B ManikanteswaraReddy