X-Original-To: pgsql-interfaces-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.130]) by svr1.postgresql.org (Postfix) with ESMTP id AD2A5D1B50F for ; Mon, 15 Sep 2003 07:12:10 +0000 (GMT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (neptune.hub.org [64.117.224.130]) (amavisd-new, port 10024) with ESMTP id 97509-09 for ; Mon, 15 Sep 2003 04:11:41 -0300 (ADT) Received: from guadiana.unex.es (guadiana.unex.es [158.49.17.23]) by svr1.postgresql.org (Postfix) with ESMTP id 886E2D1B4F0 for ; Mon, 15 Sep 2003 04:11:33 -0300 (ADT) Received: from alberto by guadiana.unex.es with local (Exim 3.35 #1 (Debian)) id 19ynW9-0002Vc-00 for ; Mon, 15 Sep 2003 09:11:25 +0200 Date: Mon, 15 Sep 2003 09:11:25 +0200 To: pgsql-interfaces@postgresql.org Subject: ColumnName and ColumnNumber in libpq (C interface) Message-ID: <20030915071125.GA7389@guadiana.unex.es> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit User-Agent: Mutt/1.3.28i From: Alberto Cabello Sanchez X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200309/27 X-Sequence-Number: 4445 I think this behaviour is not fine: I create a table with CREATE TABLE foo ("Bar" VARCHAR(1)); I thougth running this helloworldish C program: #include #include int main(int argc,char **argv) { PGconn * conn = PQconnectdb("dbname=pruebas"); PGresult * res = PQexec(conn,"SELECT * from foo"); printf("%s\n",PQfname(res,0)); printf("%d\n",PQfnumber(res,"Bar")); PQfinish(conn); } should print Bar 0 but stdout shows Bar -1 What is happening? Any ideas? Is this a bug, a feature or something I'm missing? -- ----------------------- Alberto Cabello Sánchez alberto@unex.es Servicio de Informática 924 289 351 -----------------------