Re: connect to C

From: John R Pierce <pierce(at)hogranch(dot)com>
To: pgsql-bugs(at)postgresql(dot)org
Subject: Re: connect to C
Date: 2015-11-12 19:04:17
Message-ID: 5644E2B1.4030004@hogranch.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

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

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 2015-11-12 19:41:03 Re: BUG #13741: vacuumdb does not accept valid password
Previous Message Alvaro Herrera 2015-11-12 18:52:36 Re: BUG #13772: Mistranslation in Indonesian