Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1ZwxBB-0004eg-9N for pgsql-bugs@arkaria.postgresql.org; Thu, 12 Nov 2015 19:05:05 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84) (envelope-from ) id 1ZwxBA-0003gv-Fc for pgsql-bugs@arkaria.postgresql.org; Thu, 12 Nov 2015 19:05:04 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84) (envelope-from ) id 1ZwxAY-000307-11 for pgsql-bugs@postgresql.org; Thu, 12 Nov 2015 19:04:26 +0000 Received: from hogranch.com ([75.101.82.47]) by magus.postgresql.org with esmtp (Exim 4.84) (envelope-from ) id 1ZwxAU-0000UC-GC for pgsql-bugs@postgresql.org; Thu, 12 Nov 2015 19:04:25 +0000 Received: from [192.168.0.2] (porker [192.168.0.2]) by hogranch.com (8.11.6/8.11.6) with ESMTP id tACI4Fq01940 for ; Thu, 12 Nov 2015 10:04:15 -0800 Subject: Re: connect to C To: pgsql-bugs@postgresql.org References: From: John R Pierce Message-ID: <5644E2B1.4030004@hogranch.com> Date: Thu, 12 Nov 2015 11:04:17 -0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-HawgScanner-Information: Please contact the ISP for more information X-HawgScanner: Found to be clean X-Pg-Spam-Score: -2.3 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org On 11/12/2015 4:11 AM, Hiep Pham wrote: > I have a question. Can i connect C program to postgresql in windows? > If can, Can you introduce me step by step the way for connecting? include the libpq-fe.h file, link your program with libpq.dll, and make the various libpq calls to connect to the database and issue queries, see chapter 31 in the online manual... http://www.postgresql.org/docs/current/static/libpq.html the specific details for how you compile and link are, of course, specific to the C compiler toolset you're using. the required .h and .dll files are installed with the postgres installer packages for windows, the include file is in D:\PostgreSQL\9.3\include (replace prefix with where you installed it), and the dll and .lib file for linking are in D:\PostgreSQL\9.3\lib -- john r pierce, recycling bits in santa cruz -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs