Skip site navigation (1) Skip section navigation (2)

Does psqlodbc support declare/fetch in Un ux?

From: 王宝兵 <wbbwisdom(at)163(dot)com>
To: "postgresql odbc " <pgsql-odbc(at)postgresql(dot)org>
Subject: Does psqlodbc support declare/fetch in Un ux?
Date: 2006-07-19 06:44:42
Message-ID: 44BDD4DA.00002E.05831@bj163app24.163.com (view raw or flat)
Thread:
Lists: pgsql-odbc
I am testing psqlodbc in our school.I wrote the following code:
 
...
 rtcode=SQLExecDirect(hstmt,"select * from pg_largeobject",SQL_NTS);
 if((rtcode!=SQL_SUCCESS) && (rtcode!=SQL_SUCCESS_WITH_INFO)){
  printf("SQLExecDirect Failed!\n");
  SQLFreeHandle(SQL_HANDLE_STMT,hstmt);
  SQLFreeHandle(SQL_HANDLE_DBC,hdbc);
  SQLFreeHandle(SQL_HANDLE_ENV,env);
  exit(1);
 }
 printf("|loid\t|pageno\t|data\t|\n");
 for(i=0;i<100;i++){
  SQLFetch(hstmt);
  printf("|%d\t|%d\t|%s\t|\n",loid,pageno,buffer);
 }
...
 
There are 1532240 tuples in pg_largeobject, and their size is about 3GB. But where I run this code, the client's main memory is exhausted. It seems that the client try to get all the tuples before it fetches the first 100. 
 
I think the client should get a small part first. If it need more tuples, it get anothor part and discard the first part. When I test psqlodbc in Windows, it seems to work well.
 
What's wrong? How can I fixed it?
 
Any reply will be appreciated!
 
Looking forward to your help!
 
 

Responses

pgsql-odbc by date

Next:From: noreplyDate: 2006-07-19 13:09:15
Subject: [ psqlodbc-Bugs-1000687 ] Problem with WHERE and upercase character
Previous:From: Kiran KanthetiDate: 2006-07-18 20:10:47
Subject: postgre connection via odbc

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group