X-Original-To: pgsql-interfaces-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 5C2C73A3D46 for ; Mon, 8 Nov 2004 22:24:16 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 54658-10 for ; Mon, 8 Nov 2004 22:24:10 +0000 (GMT) Received: from ll.mit.edu (LLMAIL.LL.MIT.EDU [129.55.12.40]) by svr1.postgresql.org (Postfix) with ESMTP id 717C43A40C0 for ; Mon, 8 Nov 2004 22:24:11 +0000 (GMT) Received: (from smtp@localhost) by ll.mit.edu (8.12.10/8.8.8) id iA8MOATV010528 for ; Mon, 8 Nov 2004 17:24:10 -0500 (EST) Received: from UNKNOWN( ), claiming to be "[155.34.76.160]" via SMTP by llpost, id smtpdAAAr8aGju; Mon Nov 8 17:23:59 2004 Subject: newbie libpq question... From: Doug Homoelle To: pgsql-interfaces@postgresql.org Content-Type: text/plain Message-Id: <1099952639.2819.8.camel@ > Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.6 (1.4.6-2) Date: Mon, 08 Nov 2004 17:23:59 -0500 Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=1.8 tagged_above=0.0 required=5.0 tests=INVALID_MSGID X-Spam-Level: * X-Archive-Number: 200411/22 X-Sequence-Number: 5148 I'm trying to use the libpq library for the first time and I'm experiencing what seems to be a very basic problem. When I run the following: res = PQexec(conn, "select blah blah blah"); test_int=PQntuples(res); fprintf(stdout,"number of rows: %f\n",test_int); test_int=PQnfields(res); fprintf(stdout,"number of cols: %f\n",test_int); where "blah blah blah" is the selection criteria, I get zero rows and zero columns. When I do the exact same "select" query through the psql interface I get 547 rows and 3 columns. I've checked that PQresultStatus = PGRES_TUPLES_OK, so it seems like it completed the command correctly. I'm new to postgres and I haven't used C in a long while so I'm a little rusty there. Am I missing something obvious? thanks in advance for any insight, dh