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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
ivansz
Regular 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 REPLIES 2
ivansz
Regular 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
Resolver IV
Resolver IV

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.

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.