Return-Path: owner-postman
Received: from localhost.Berkeley.EDU (localhost.Berkeley.EDU [127.0.0.1]) by nobozo.CS.Berkeley.EDU (8.6.9/8.6.3) with SMTP id QAA04660 for postgres-redist; Fri, 16 Sep 1994 16:31:48 -0700
Resent-From: POSTGRES mailing list <postman@postgres.Berkeley.EDU>
Resent-Message-Id: <199409162331.QAA04660@nobozo.CS.Berkeley.EDU>
Sender: owner-postman@postgres.Berkeley.EDU
X-Return-Path: owner-postman
Received: from faerie.CS.Berkeley.EDU (faerie.CS.Berkeley.EDU [128.32.37.53]) by nobozo.CS.Berkeley.EDU (8.6.9/8.6.3) with ESMTP id QAA04650 for <postgres@postgres.Berkeley.EDU>; Fri, 16 Sep 1994 16:31:47 -0700
Received: from localhost.Berkeley.EDU (localhost.Berkeley.EDU [127.0.0.1]) by faerie.CS.Berkeley.EDU (8.6.9/8.1B) with SMTP id QAA01962; Fri, 16 Sep 1994 16:31:44 -0700
Message-Id: <199409162331.QAA01962@faerie.CS.Berkeley.EDU>
X-Authentication-Warning: faerie.CS.Berkeley.EDU: Host localhost.Berkeley.EDU didn't use HELO protocol
From: aoki@cs.berkeley.edu (Paul M. Aoki)
To: pmamnani@cs.nmsu.edu (Praveen Mamnani)
Cc: postgres@postgres.Berkeley.EDU
Subject: libpq append
Reply-To: aoki@cs.berkeley.edu (Paul M. Aoki)
In-reply-to: Your message of Fri, 16 Sep 1994 17:08:00 -0600 
	     <199409162308.RAA29779@NMSU.Edu> 
Date: Fri, 16 Sep 94 16:31:38 -0700
X-Sender: aoki@postgres.Berkeley.EDU
Resent-To: postgres-redist@postgres.Berkeley.EDU
X-Mts: smtp
Resent-Date: Fri, 16 Sep 94 16:31:48 -0700
Resent-XMts: smtp

pmamnani@cs.nmsu.edu (Praveen Mamnani) writes:
> I tried PQexec("append..."), 
> but this does not seem to work. I am not sure that libpq allows
> execution of such queries using PQexec.

it does, and by-and-large it works.  (this example maximizes 
minimality rather than correctness.)

faerie:postgres (7)> cat foo.c
main()
{
  (void) PQsetdb("foo");
  (void) PQexec("create bar (x=int4)");
  (void) PQexec("append bar (x=5)");
  (void) PQfinish();
}
faerie:postgres (8)> cc foo.c /private/devel/postgres/lib/libpq.a
faerie:postgres (9)> a.out 
faerie:postgres (10)> monitor -c 'retrieve (bar.all)' foo
---------------
| x           |
---------------
| 5           |
---------------
faerie:postgres (11)> 

there are examples of retrieving rows in the reference manual and 
under src/regress.
--
  Paul M. Aoki          |  University of California at Berkeley
  aoki@CS.Berkeley.EDU  |  Dept. of EECS, Computer Science Division (#1776) 
                        |  Berkeley, CA 94720-1776

==============================================================================
   To add/remove yourself to/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.
==============================================================================
