pg.ddx.io  pgsql-odbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Does psqlodbc support declare/fetch in Un ux?
2+ messages / 2 participants
[nested] [flat]

* Does psqlodbc support declare/fetch in Un ux?
@ 2006-07-19 06:44  王宝兵 <wbbwisdom@163.com>
  0 siblings, 1 reply; 2+ messages in thread

From: 王宝兵 @ 2006-07-19 06:44 UTC (permalink / raw)
  To: 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!
 
 

^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* Re: Does psqlodbc support declare/fetch in Un ux?
@ 2006-07-20 07:09  Ludek Finstrle <luf@pzkagis.cz>
  parent: 王宝兵 <wbbwisdom@163.com>
  0 siblings, 0 replies; 2+ messages in thread

From: Ludek Finstrle @ 2006-07-20 07:09 UTC (permalink / raw)
  To: 王宝兵 <wbbwisdom@163.com>; +Cc: pgsql-odbc

> 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. 
>  
> What's wrong? How can I fixed it?

What connection string? What's the settings in odbc.ini?
The first question is if you are using declare/fetch.

Could you send us the mylog output?

Regards,

Luf



^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2006-07-20 07:09 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2006-07-19 06:44 Does psqlodbc support declare/fetch in Un ux? 王宝兵 <wbbwisdom@163.com>
2006-07-20 07:09 ` Ludek Finstrle <luf@pzkagis.cz>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox