agora inbox for postgres@postgres.berkeley.edu  
help / color / mirror / Atom feed
From: Tung-Hsin Su <thsu@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
Message-ID: <9311110904.AA03235@uranus.ccl.itri.org.tw> (raw)

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.                                  |
|                                                                 |
+=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=+



reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: postgres@postgres.berkeley.edu
  Cc: thsu@uranus.ccl.itri.org.tw
  Subject: Re: One problwms in PQlib of POSTGRES
  In-Reply-To: <9311110904.AA03235@uranus.ccl.itri.org.tw>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

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