March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now
Hi Team,
I am encountering issues while trying to connect to the PostgreSQL database from Power BI Desktop.
Below is the screenshot of the error message-
Error message: "PostgreSQL: Exception while reading from stream"
This is a high-priority issue for me. Could anyone please advice on how to resolve this?
Thank you!
Hi @Sorrowless
Thank you very much rajendraongole1 for your prompt reply.
Regards,
Nono Chen
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @Sorrowless - You can use a tool like pgAdmin or a command-line tool to see if you can connect to the database without issues.
If you’re connecting to a remote server, check if there are any network firewalls or VPNs that might be interrupting the connection.Make sure the PostgreSQL server's postgresql.conf and pg_hba.conf files are correctly configured to allow connections from your IP address or network range.
Restart the PostgreSQL service after making any changes to these files.
Power BI might be trying to connect using SSL, which may not be properly configured on your PostgreSQL server. You can adjust SSL settings in the connection string by specifying SSL Mode=Disable, if SSL is not required.
Alternatively, if SSL is required, ensure that it is correctly configured on the server side and that Power BI can connect using SSL.Make sure you are running the latest version of Power BI Desktop. Updates often include bug fixes and improvements for connectivity issues.
Hope after performing these steps, try reconnecting in Power BI Desktop it works.
Proud to be a Super User! | |
Hi @rajendraongole1 ,
Thank you for responding.
When I tried giving a value (100) in the 'Command timout' under 'Advance options', Power BI is able to retrieve the data but it took more than an hour. But when I run the same query in DBeaver, it just took a minute to retrieve the data.
I am not really sure about what is causing the issue in this case.
Thank you!
Hi @Sorrowless - Try to simplify your Power Query transformations if possible, or ensure they’re pushed directly to the database using query folding. You can check query folding by right-clicking on a step in Power Query and seeing if the "View Native Query" option is available. Ensure that network connectivity is stable. You might also try connecting Power BI to PostgreSQL via a VPN if latency is an issue.
very important: If your dataset isn't too large for Power BI's memory limits, try switching to Import mode.
Try updating the PostgreSQL driver that Power BI uses. You can download the latest version of the PostgreSQL ODBC driver or switch to an alternative PostgreSQL connector if available.
Review and optimize your query directly within PostgreSQL. If possible, add indexing or optimize joins and filtering. This can sometimes drastically reduce the time required to retrieve data, even from external tools like Power BI.
hope the above suggestions helps. Check for any known issues with the current Power BI Desktop version and consider updating or rolling back to a previous version to see if performance improves.
Previous monthly updates to Power BI Desktop and the Power BI service - Power BI | Microsoft Learn
Proud to be a Super User! | |
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
User | Count |
---|---|
94 | |
86 | |
82 | |
76 | |
49 |
User | Count |
---|---|
160 | |
144 | |
103 | |
74 | |
57 |