Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
I am encountering an issue while loading data from PostgreSQL using the ODBC connector in Power bi desktop. The error message i receiveis"
"DataSource.Error: ODBC: ERROR [HY001] Out of memory while reading tuples.;
memory allocation error???
Details:
DataSourceKind=Odbc
DataSourcePath=dsn=gtn-db
OdbcErrors=[Table]
Does anyone know what might be causing this error?
Any advice you can offer would be most appreciated.
Solved! Go to Solution.
The error message you're seeing:
"ODBC: ERROR [HY001] Out of memory while reading tuples"
means that Power BI (or the underlying ODBC driver) is running out of memory when trying to retrieve a large amount of data from PostgreSQL via ODBC.
This typically happens due to one or more of the following:
Large volume of data being fetched in a single query (millions of rows or wide tables).
Insufficient memory on your machine (Power BI Desktop is memory-intensive).
ODBC driver limitations in terms of memory buffer allocation.
Power BI default settings causing Power Query to load entire data into memory for transformations.
No query folding – transformations applied in Power BI are not pushed to PostgreSQL, causing massive memory usage locally.
Instead of ODBC, use PostgreSQL native connector in Power BI:
Home → Get Data → Database → PostgreSQL
Ensure Npgsql PostgreSQL driver is installed: Npgsql download
This is more efficient and supports query folding, reducing memory usage.
In Power Query, apply filters on:
Date columns (e.g., last 6 months)
ID ranges, top N rows, or where conditions
Always preview a smaller subset before importing the full data.
Go to Power Query → Advanced Editor → Use a custom SQL query:
SELECT column1, column2 FROM your_table WHERE created_at >= CURRENT_DATE - INTERVAL '6 months'
This reduces the amount of data fetched at source level.
If you're stuck with ODBC:
Try increasing ODBC driver's memory buffer in ODBC settings.
On 64-bit Power BI, ensure you’re using 64-bit ODBC driver.
Close other memory-intensive apps.
Avoid transformations in Power BI that break query folding (like adding index columns, merging, etc.).
Right-click steps in Power Query and check if “View Native Query” is available. If not, try simplifying steps.
Hi @Kbhasin04,
we would like to follow up to see if the solution provided by the super user resolved your issue. Please let us know if you need any further assistance.
If our super user response resolved your issue, please mark it as "Accept as solution" and click "Yes" if you found it helpful.
Regards,
Vinay Pabbu
Hi @Kbhasin04,
we would like to follow up to see if the solution provided by the super user resolved your issue. Please let us know if you need any further assistance.
If our super user response resolved your issue, please mark it as "Accept as solution" and click "Yes" if you found it helpful.
Regards,
Vinay Pabbu
Hi @Kbhasin04,
we would like to follow up to see if the solution provided by the super user resolved your issue. Please let us know if you need any further assistance.
If our super user response resolved your issue, please mark it as "Accept as solution" and click "Yes" if you found it helpful.
Regards,
Vinay Pabbu
The error message you're seeing:
"ODBC: ERROR [HY001] Out of memory while reading tuples"
means that Power BI (or the underlying ODBC driver) is running out of memory when trying to retrieve a large amount of data from PostgreSQL via ODBC.
This typically happens due to one or more of the following:
Large volume of data being fetched in a single query (millions of rows or wide tables).
Insufficient memory on your machine (Power BI Desktop is memory-intensive).
ODBC driver limitations in terms of memory buffer allocation.
Power BI default settings causing Power Query to load entire data into memory for transformations.
No query folding – transformations applied in Power BI are not pushed to PostgreSQL, causing massive memory usage locally.
Instead of ODBC, use PostgreSQL native connector in Power BI:
Home → Get Data → Database → PostgreSQL
Ensure Npgsql PostgreSQL driver is installed: Npgsql download
This is more efficient and supports query folding, reducing memory usage.
In Power Query, apply filters on:
Date columns (e.g., last 6 months)
ID ranges, top N rows, or where conditions
Always preview a smaller subset before importing the full data.
Go to Power Query → Advanced Editor → Use a custom SQL query:
SELECT column1, column2 FROM your_table WHERE created_at >= CURRENT_DATE - INTERVAL '6 months'
This reduces the amount of data fetched at source level.
If you're stuck with ODBC:
Try increasing ODBC driver's memory buffer in ODBC settings.
On 64-bit Power BI, ensure you’re using 64-bit ODBC driver.
Close other memory-intensive apps.
Avoid transformations in Power BI that break query folding (like adding index columns, merging, etc.).
Right-click steps in Power Query and check if “View Native Query” is available. If not, try simplifying steps.
Hi @Kbhasin04 This error can occur due to large data volumes or insufficient memory. Try limiting the data using filters, optimizing PostgreSQL queries, and increasing virtual memory. Switching to DirectQuery mode can also help avoid loading all data into memory.
Hi @Akash_Varuna , thanks for your response. I have tried these steps but still same issue presists. Also tried to add parameter and to load only 1000 records but its not allowing that thing aswell.
@Kbhasin04 Could you try updating your PostgreSQL ODBC driver and ensure Power BI Desktop is also up-to-date? If possible try , switching from the ODBC connector to Power BI’s native PostgreSQL connector might help. Also, please check if your queries are optimized and indexed for better performance.
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!