X-Original-To: pgsql-odbc-postgresql.org@postgresql.org Received: from localhost (mx1.hub.org [200.46.208.251]) by postgresql.org (Postfix) with ESMTP id 3DFB19FA5C3 for ; Wed, 19 Jul 2006 04:01:50 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) with ESMTP id 78787-08 for ; Wed, 19 Jul 2006 04:01:41 -0300 (ADT) X-Greylist: delayed 00:16:50.384226 by SQLgrey- Received: from m13-24.163.com (m13-24.163.com [220.181.13.24]) by postgresql.org (Postfix) with SMTP id E95509FA430 for ; Wed, 19 Jul 2006 04:01:39 -0300 (ADT) Received: from 192.168.193.192(219.237.17.142, 192.168.208.44) ( 192.168.193.192(219.237.17.142, 192.168.208.44) [192.168.193.192(219.237.17.142, 192.168.208.44)] ) by webmail-app24 (Coremail) ; Wed, 19 Jul 2006 14:44:42 +0800 (CST) MIME-Version: 1.0 Message-ID: <44BDD4DA.00002E.05831@bj163app24.163.com> Date: Wed, 19 Jul 2006 14:44:42 +0800 (CST) From: "=?gb2312?B?zfWxprH4?=" To: "postgresql odbc " Subject: Does psqlodbc support declare/fetch in Un ux? X-Priority: 3 X-Originating-IP: [192.168.193.192(219.237.17.142, 192.168.208.44)] X-Mailer: 163com Content-Type: Multipart/Alternative; boundary="Boundary-=_cQXKYALnQFLfHEGWRWEzItnljcfh" X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=4.028 tagged_above=0 required=5 tests=BAYES_50, DNS_FROM_AHBL_RHSBL, DNS_FROM_RFC_ABUSE, DNS_FROM_RFC_POST, DNS_FROM_SECURITYSAGE, HTML_30_40, HTML_MESSAGE, SPF_PASS, UNPARSEABLE_RELAY X-Spam-Level: **** X-Archive-Number: 200607/18 X-Sequence-Number: 7929 --Boundary-=_cQXKYALnQFLfHEGWRWEzItnljcfh Content-Type: text/plain; charset="gb2312" Content-Transfer-Encoding: 7bit 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! --Boundary-=_cQXKYALnQFLfHEGWRWEzItnljcfh Content-Type: text/html; charset="gb2312" Content-Transfer-Encoding: quoted-printable
I am testing psqlodbc in our school.I wrote the following code:
 
...
 rtcode=3DSQLExecDirect(hstmt,"select * from pg_largeobject",SQ= L_NTS);
 if((rtcode!=3DSQL_SUCCESS) && (rtcode!=3DSQL_SUC= CESS_WITH_INFO)){
  printf("SQLExecDirect Failed!\n");
&n= bsp; SQLFreeHandle(SQL_HANDLE_STMT,hstmt);
  SQLFreeHan= dle(SQL_HANDLE_DBC,hdbc);
  SQLFreeHandle(SQL_HANDLE_ENV,env= );
  exit(1);
 }
 printf("|loid\t|pageno\t|d= ata\t|\n");
 for(i=3D0;i<100;i++){
  SQLFetch(hst= mt);
  printf("|%d\t|%d\t|%s\t|\n",loid,pageno,buffer);
&= nbsp;}
...
 
There are 1532240 tuples in pg_largeobject, and their size is a= bout 3GB. But where I run this code, the client's main memory is exhauste= d. It seems that the client try to get all the tuples before it fetches t= he first 100.
 
I think the client should get a small part first. If it need more tu= ples, it get anothor part and discard the first part. When I test psqlodb= c 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!
 
 







=09=CF=EB =D2=AA =CC=E5 = =D1=E9 =D2=BB =CF=C2 =B3=AC =B4=F3 =B3=AC =BF=EC =B5=C4 =C3=E2 =B7=D1 =D3= =CA =CF=E4 =C2=F0 =A3=BF =09
=09 =CD=F8 =D2=D7 3G =C3=E2 =B7=D1 =D3=CA =A3= =AC=C7=C0 =D7=A2 =D4=D9 =B5=C3 280 =D5=D7 =B4=F3 =C8=DD =C1=BF =CD=F8 =C5= =CC =A3=AC=BF=EC =C0=B4 =CC=E5 =D1=E9 =D3=CA =CF=E4 =BC=AB =CB=D9 =D6=AE = =C2=C3 --Boundary-=_cQXKYALnQFLfHEGWRWEzItnljcfh--