Return-Path: owner-postman
Received: from localhost (localhost [127.0.0.1]) by nobozo.CS.Berkeley.EDU (8.6.4/8.6.3) with SMTP id BAA28940 for postgres-dist; Thu, 11 Nov 1993 01:00:11 -0800
Resent-From: POSTGRES mailing list <postman@postgres.Berkeley.EDU>
Resent-Message-Id: <199311110900.BAA28940@nobozo.CS.Berkeley.EDU>
X-Authentication-Warning: nobozo.CS.Berkeley.EDU: Host localhost didn't use HELO protocol
Sender: owner-postman@postgres.Berkeley.EDU
X-Return-Path: owner-postman
Received: from TWNMOE10.Edu.TW (twnmoe10.edu.tw [192.83.166.3]) by nobozo.CS.Berkeley.EDU (8.6.4/8.6.3) with SMTP id AAA28926 for <postgres@nobozo.CS.Berkeley.EDU>; Thu, 11 Nov 1993 00:59:45 -0800
Received: from comserv.itri.org.tw by TWNMOE10.Edu.TW (IBM VM SMTP V2R2)
   with TCP; Thu, 11 Nov 93 16:59:17 EST
Received: by comserv.itri.org.tw (ITRI1.0s) from ccl.itri.org.tw (oax2.ccl.itri.org.tw) 
 	id AA06567; Thu, 11 Nov 93 16:58:22+080
Received: by  oax2.ccl.itri.org.tw (th3.8r) from uranus.ccl.itri.org.tw 
 		id AA23613; Thu, 11 Nov 93 16:58:13 CST	
Received: by uranus.ccl.itri.org.tw (4.1/SMI-4.1)
	id AA03235; Thu, 11 Nov 93 17:04:23 CST
Message-Id: <9311110904.AA03235@uranus.ccl.itri.org.tw>
To: postgres@postgres.Berkeley.EDU
Subject: One problwms in PQlib of POSTGRES
Date: Thu, 11 Nov 93 17:04:22 U
From: Tung-Hsin Su <thsu@uranus.ccl.itri.org.tw>
Resent-To: postgres-dist@postgres.Berkeley.EDU
Resent-Date: Thu, 11 Nov 93 01:00:11 -0800
Resent-XMts: smtp

Hi,
   I have one problems in calling library (PQlib) of POSTGRES. 
My problem  is that the "PQputline and PQendcopy" do not work well.
I try the example in PQlib document but it  does not work  and it hangs
up at "PQendcopy" routine call. My program is as follows:

-------------- program begin -----------
#include <stdio.h>
#include "tmp/libpq.h"

main ()
{
    int i, j, k, g, n, m, t;
    PortalBuffer    *p;
    char pnames[MAXPORTALS][portal_name_length];

    /* specify the database to access */
    PQsetdb ("yang");

    PQexec("begin");
    PQexec("create foo ( a=int4, b=char16, d=float8)");
    PQexec("copy foo from stdin");
    PQputline("3        hello world     4.50");
    PQputline("4        goodbye world   7.11");
    PQputline("5        yes             9.0");
    PQputline(".\n");
    if (PQendcopy() != 0 ) {
        printf("error\n");
    }
    if (PQendcopy() != 0 ) {    <<<-- hangs up here !!
        printf("error\n");
    }
    PQexec("end");
    PQfinish ();
}
-------------- end of program ---------- 




                                                                   
+=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=+
|          Name: Tung-Hsin Su                                     |
|    Department: k200, Distributed Computing System Dept.         |
|  Office Phone: (035) 91-7390			       		  |
|    Home Phone: (035) 307330			      		  |
|           Fax: (035) 95-7826			      		  |
|        E-mail: thsu@dcs.ccl.itri.org.tw                         |
|Office Address: Computer and Communication Laboratories,         | 
|                Industrial Technology Research Institute         |
|                195-4-w100, Sec. 4, Chun-Hsing Rd.               |
|                Chu-Tung, Hsin-Chu 31015		          | 
|                Taiwan   R.O.C.                                  |
|                                                                 |
+=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=+
