X-Original-To: pgsql-interfaces-postgresql.org@postgresql.org Received: from localhost (mx1.hub.org [200.46.208.251]) by postgresql.org (Postfix) with ESMTP id 2B9B39FB3A7 for ; Tue, 1 Aug 2006 03:35:05 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) with ESMTP id 79837-03-4 for ; Tue, 1 Aug 2006 03:34:29 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey- Received: from fep05.ttnet.net.tr (mail.ttnet.net.tr [212.175.13.129]) by postgresql.org (Postfix) with ESMTP id 242909FB3DF for ; Tue, 1 Aug 2006 03:04:58 -0300 (ADT) Received: from by AVGW-I-1.ttnet.net.tr via smtp id 1ce6_a928d88e_2123_11db_9a78_001422175f0e; Tue, 01 Aug 2006 09:04:58 +0300 Received: from alamut ([212.174.26.173]) by fep05.ttnet.net.tr with ESMTP id <20060801060451.NRME10864.fep05.ttnet.net.tr@alamut>; Tue, 1 Aug 2006 09:04:51 +0300 Date: Tue, 1 Aug 2006 09:02:52 +0300 From: Volkan YAZICI To: =?utf-8?Q?Tu=C4=9Fberk?= Kara Cc: pgsql-interfaces@postgresql.org Subject: Re: connection problem Message-ID: <20060801060252.GA1323@alamut.tdm.local> References: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.4.2.1i X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=1.605 tagged_above=0 required=5 tests=AWL, RAZOR2_CF_RANGE_51_100, RAZOR2_CF_RANGE_E8_51_100, RAZOR2_CHECK, SPF_PASS, UNPARSEABLE_RELAY X-Spam-Level: * X-Archive-Number: 200608/1 X-Sequence-Number: 6215 On Jul 31 10:18, Tuğberk Kara wrote: > PGconn *conn=NULL; > char *conn_str="hostaddr=172.16.11.2 port=5432 dbname=postgres > user=postgres password=654321 reqiressl=0"; > conn=PGconnectStart(conn_str); > if(PGstatus(conn)=CONNECTION_BAD){ > > PGerrorMessage(conn); > } > else{ > > printf("connected"); > > } You're using totally wrong functions. There's even doesn't exist a function called PGconnectStart(). First of all, I'd suggest you to either reading libpq manual[1] in the PostgreSQL documentation or "PostgreSQL ile Programlama"[2] (in Turkish) book's C API related section. [1] www.postgresql.org/docs/current/interactive/libpq.html [2] http://www.students.itu.edu.tr/~yazicivo/doc/postgresql-ile-programlama-20060214.pdf Regards.