Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
Sorrowless
Regular Visitor

PostgreSQL: Exception while reading from stream

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-

Sorrowless_0-1731486791356.png

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!

4 REPLIES 4
Anonymous
Not applicable

Hi @Sorrowless

 

Thank you very much rajendraongole1 for your prompt reply.

 

Someone has encountered the same problem and the solution mentioned here is to turn on the firewall. This may help you solve the problem:
 
rajendraongole1
Super User
Super User

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.

PostgreSQL: File Browser

 

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. 

 





Did I answer your question? Mark my post as a solution!

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





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.