Forum Discussion

Alex_Ooi's avatar
Alex_Ooi
Helper IV
6 years ago
Solved

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.

 

 

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.

  • 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.

5 Replies

  • mwegener's avatar
    mwegener
    Most Valuable Professional

    Hi Alex_Ooi ,

     

    did you try to increase the timeout?

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

    Please give Kudos for support.

      • v-xuding-msft's avatar
        v-xuding-msft
        Community Support

        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.