Page 1 of 1

FetchSize Query

Posted: Mon 02 Oct 2006 12:49
by JonC
I'm experiencing something odd when using PgSqlCommand with FetchSize.

Code: Select all

PgSqlCommand pgCommand = new PgSqlCommand("select column_name from table_name", myPgConnection);
pgCommand.FetchAll = false;
pgCommand.FetchSize = 10000;
pgSqlDataReader pgReader = pgCommand.ExecuteReader();
long Counter = 0;
while(pgReader.Read())
    ++Counter;

Console.WriteLine("{0} records read", Counter);
This will give me a total of 400,000 records. However, I know I've got just over 407,000 records, so if I then do

Code: Select all

while(pgReader.Read())
    ++Counter;

Console.WriteLine("{0} records read", Counter);
(so in effect forcing the loop again) I then get the correct amount out. I've tried this with varying values of FetchSize and it appears to be the last 'chunk' isn't retrieved. So for above, if I change FetchSize to be 5,000, then 405,000 is retrieved (in the main Read()), and 2,000 odd in the additional Read().


I'm not sure if this is a potential bug, me not using the feature correctly, or some weird configuration on my system, but thought I'd throw it your way for comment.

Cheers,

Jon.

Posted: Tue 03 Oct 2006 07:08
by Alexey
We are investigating this problem. You'll be notified on results as soon as possible.

Posted: Wed 11 Oct 2006 15:10
by JonC
Any news on this? The trial period is running out, and I'm a little wary of purchasing a product that forces me to write ugly and redundant code...

Posted: Wed 11 Oct 2006 15:56
by Alexey
We cannot reproduce this problem for now. Need more time for investigation. If you would send us small test project to reproduce this, it would be very helpful.

Posted: Wed 11 Oct 2006 16:05
by JonC
I take it a C# file and a pgdump of a sample database will be sufficient?

Posted: Thu 12 Oct 2006 10:29
by Alexey
Yes, create a small test project and send it with dump of the database. Use e-mail address provided in the Readme file.