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

Be 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

Reply
ivansz
Frequent Visitor

integer out of range error when merging two tables

I have a Power BI report getting data from multiple tables in PostgreSQL database. The model has been working well for a while, but since today I get an error when I want to refresh the data: "OLE DB or ODBC error: [DataSource.Error] PostgreSQL: 22003: integer out of range." The strange thing is that I get this error at the step when I merge two tables. Reading data from table1 works fine. Readind data from table2 works fine too. But at the step where I merge queries using inner join. I get the error. If I remove the merge the data refresh works fine. The column to do the mege is an integer (int8 in PosgreSQL) and it is the Primary key-Foreign Key of the two tables in the database. Any idea what can be the problem? Or how can I determine which value casues the issue. (Max value in the column is 216380.)

2 ACCEPTED SOLUTIONS
Alex87
Super User
Super User

The error you're encountering, "OLE DB or ODBC error: [DataSource.Error] PostgreSQL: 22003: integer out of range," suggests that during the data processing within Power BI (especially during the merging step), an integer value is being processed that exceeds the allowable range for the data type expected by the PostgreSQL database. In PostgreSQL, an int8 is an 8-byte integer, which should be more than sufficient to handle any integer values.

Check your data types in Power Bi, try to examine the merge process and simplify it to debug, validate the data integrity by looking for extreme values that could generate the error.




Did I answer your question? Mark my post as a solution!
Appreciate your Like/Kudos

Proud to be a Super User!




View solution in original post

ivansz
Frequent Visitor

Finally, I found the root cause of the problem: One of the queries reads data from a view in the database and in that view one of the calculated columns got this "out of range" error. What is still a mystery that when I removed the merging in PowerBI all table refreshed without a problem (seemingly).

View solution in original post

2 REPLIES 2
ivansz
Frequent Visitor

Finally, I found the root cause of the problem: One of the queries reads data from a view in the database and in that view one of the calculated columns got this "out of range" error. What is still a mystery that when I removed the merging in PowerBI all table refreshed without a problem (seemingly).

Alex87
Super User
Super User

The error you're encountering, "OLE DB or ODBC error: [DataSource.Error] PostgreSQL: 22003: integer out of range," suggests that during the data processing within Power BI (especially during the merging step), an integer value is being processed that exceeds the allowable range for the data type expected by the PostgreSQL database. In PostgreSQL, an int8 is an 8-byte integer, which should be more than sufficient to handle any integer values.

Check your data types in Power Bi, try to examine the merge process and simplify it to debug, validate the data integrity by looking for extreme values that could generate the error.




Did I answer your question? Mark my post as a solution!
Appreciate your Like/Kudos

Proud to be a Super User!




Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.