I have a .NET 6 C# console app connected to Denodo using Npgsql.
The main task is just to pull data with SELECT
using different queries. Now I'm facing an error with one of the largest queries with 29K lines (it's big because it has some mapping to manage historic data).
The error that I get is:
Npgsql.PostgresException: Invalid data received. Length: 1816347. Max length of data: 1048576 bytes
This error happens just after the ExecuteReaderAsync
.
As a reference, this is the fragment that executes the query:
await using var dataSource = NpgsqlDataSource.Create(connectionString);
await using (var cmd = dataSource.CreateCommand(query))
await using (var reader = await cmd.ExecuteReaderAsync())
{
dsResult.Load(reader);
}
I tried to modify the app.config adding: Read Buffer Size=18000000;Socket Send Buffer Size=18000000;Maximum Pool Size=100;
in the connection string with the same error message.
I thank you in advance for any guide about how to allow Npgsql to execute big queries.