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 A82373A4086 for ; Mon, 8 Nov 2004 22:36:33 +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 60133-08 for ; Mon, 8 Nov 2004 22:36:23 +0000 (GMT) Received: from ll.mit.edu (LLMAIL.LL.MIT.EDU [129.55.12.40]) by svr1.postgresql.org (Postfix) with ESMTP id 99BA23A40E5 for ; Mon, 8 Nov 2004 22:36:25 +0000 (GMT) Received: (from smtp@localhost) by ll.mit.edu (8.12.10/8.8.8) id iA8MaO8E023825 for ; Mon, 8 Nov 2004 17:36:24 -0500 (EST) Received: from UNKNOWN( ), claiming to be "[155.34.76.160]" via SMTP by llpost, id smtpdAAAzoaG0T; Mon Nov 8 17:36:10 2004 Subject: newbie libpq question... From: Doug Homoelle To: pgsql-interfaces@postgresql.org Content-Type: text/plain Message-Id: <1099953369.2819.11.camel@ > Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.6 (1.4.6-2) Date: Mon, 08 Nov 2004 17:36:09 -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/9 X-Sequence-Number: 5135 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