agora inbox for postgres@postgres.berkeley.edu  
help / color / mirror / Atom feed
From: Paul M. Aoki <aoki@postgres.Berkeley.EDU>
To: perera@pollux.cs.uga.edu
Cc: postgres@postgres.Berkeley.EDU
Subject: Re: libpq question.
Date: Mon, 09 May 94 17:06:29 -0700
Message-ID: <199405100006.RAA29481@faerie.CS.Berkeley.EDU> (raw)
In-Reply-To: <9405040222.AA21010@pollux.cs.uga.edu>

perera@pollux.cs.uga.edu writes:
> 	...
> 	char *q1 = "define view toy ( sno = s.sno, city = s.city )";
> 	char *q2 = "retrieve ( toy.all )";
> 	char *response = NULL;
> 	response = (char *) PQexec(q1);  /*  response has CAPPEND 373920 */
> 	response = (char *) PQexec(q2);  /*  response has CDEFINE */
> 	response = (char *) PQexec(q2);  /*  response has Pblank */
> 	...
> Why is that the first time I do query q2 I get a CDEFINE and the next time
> I get a Pblank ? I thought that doing a retrieve gives a "Pblank" from PQexec

there is some discussion of this in the new reference manual under
libpq.  the basic protocol is hosed; some commands invoke postquel 
queries to do some of their work, which means that they return
multiple return status messages, and about all you can do is poke 
at the connection until you know the backend is done sending status 
messages.

look around under PQexec and PQFlushI.

monitor.c also has some code to handle this problem.
--
  Paul M. Aoki  |  CS Div., Dept. of EECS, UCB  |  aoki@postgres.Berkeley.EDU
                |  Berkeley, CA 94720           |  ...!uunet!ucbvax!aoki

===============================================================================
    To add/remove yourself from the POSTGRES mailing list: send mail with 
    the subject line ADD or DEL to "postgres-request@postgres.Berkeley.EDU"

    If this fails, send mail to "post_questions@postgres.Berkeley.EDU" and
    a human will deal with it.  DO NOT post to the "postgres" mailing list.
===============================================================================




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: aoki@postgres.Berkeley.EDU, perera@pollux.cs.uga.edu
  Subject: Re: libpq question.
  In-Reply-To: <199405100006.RAA29481@faerie.CS.Berkeley.EDU>

* 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