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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
Alex_Ooi
Helper IV
Helper IV

PostgreSQL Timeout Error

Hi,

 

I need your expert advice and possible workarounds that are not too manual for the timeout error I encounter every time I query my dB in PostgreSQL. This is the same type of error appearing in Excel's Power Query and Power BI.

 

timeout.jpg

 

I am not a developer, so the concept of "duplicating" tables/queries into another dB is foreign to me. Another solution that I am currently using is of course to download my query on specific intervals - currently, every end of month - into a folder where I could use Folder.Files ( ) function.

 

The issue arises when sometimes my users require views that fall out of the specific intervals. For example, I have not downloaded the query for December today, but my users require information from 1 - 22 December. I find my current way of working is still manual.

 

Any idea how I can workaround the timeout error, so I can do a schedule refresh in Power BI to always get the latest insights?

 

Your advices are much appreciated.

1 ACCEPTED SOLUTION

Hi @Alex_Ooi ,

Maybe you could reference the ways to change timeout parameters to check if you could connect the data source without an error. 

 

1. Add timeout parameter to connection string:

  • Connect Timeout=xx  (xx = seconds)

2. Otherwise, you could add  timeout parameter to Query argument within M Code / Advanced Editor:

  • let
    Source =
    Odbc.DataSource(
    xxxxxxxxxxxxxxxxx,
    [Query = "xxxxxxxxx",CommandTimeout =#duration(0,1,0,0)]
    )
    in
    Source 

 

Reference:

https://docs.microsoft.com/en-us/powerquery-m/odbc-datasource

 

Best Regards,

Xue Ding

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Best Regards,
Xue Ding
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

5 REPLIES 5

Hi @Alex_Ooi ,

 

did you try to increase the timeout?

Postgres.png

If I answered your question, please mark my post as solution, this will also help others.

Please give Kudos for support.

Did I answer your question?
Please mark my post as solution, this will also help others.
Please give Kudos for support.

Marcus Wegener works as Full Stack Power BI Engineer at BI or DIE.
His mission is clear: "Get the most out of data, with Power BI."
twitter - LinkedIn - YouTube - website - podcast


Hi @mwegener there are issues with connecting directly with PostgreSQL (query folding). Discussion thread here: https://community.powerbi.com/t5/Desktop/Query-Folding-disable/m-p/873976#M419092

 

As such, I connected using ODBC which does not allow me to change timeout.

 

I am afraid the only way to do this is to query by batch and merge query later. But I am concerned about the optimisation since I don't have Premium to do incremental refresh.

 

Timeout2.jpg

Hi @Alex_Ooi ,

 

what are your issues with query folding?

 

Did I answer your question?
Please mark my post as solution, this will also help others.
Please give Kudos for support.

Marcus Wegener works as Full Stack Power BI Engineer at BI or DIE.
His mission is clear: "Get the most out of data, with Power BI."
twitter - LinkedIn - YouTube - website - podcast


Hi @Alex_Ooi ,

Maybe you could reference the ways to change timeout parameters to check if you could connect the data source without an error. 

 

1. Add timeout parameter to connection string:

  • Connect Timeout=xx  (xx = seconds)

2. Otherwise, you could add  timeout parameter to Query argument within M Code / Advanced Editor:

  • let
    Source =
    Odbc.DataSource(
    xxxxxxxxxxxxxxxxx,
    [Query = "xxxxxxxxx",CommandTimeout =#duration(0,1,0,0)]
    )
    in
    Source 

 

Reference:

https://docs.microsoft.com/en-us/powerquery-m/odbc-datasource

 

Best Regards,

Xue Ding

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Best Regards,
Xue Ding
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hi @v-xuding-msft the default command timeout using this function seems fine to me, 10 mins. It is just that my server defaults its command timeout by 2 minutes. After reading this document, I think there is nothing that Power BI (or any other IDEs) can do much besides having my tech team to change the command timeout for me.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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