pg.ddx.io pgsql-bugs@postgresql.org mailing list archive
help / color / mirror / Atom feedconnect to C
3+ messages / 3 participants
[nested] [flat]
* connect to C
@ 2015-11-12 12:11 Hiep Pham <hieppso194@gmail.com>
0 siblings, 2 replies; 3+ messages in thread
From: Hiep Pham @ 2015-11-12 12:11 UTC (permalink / raw)
To: pgsql-bugs
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?
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: connect to C
@ 2015-11-12 19:04 John R Pierce <pierce@hogranch.com>
parent: Hiep Pham <hieppso194@gmail.com>
1 sibling, 0 replies; 3+ messages in thread
From: John R Pierce @ 2015-11-12 19:04 UTC (permalink / raw)
To: 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
--
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: connect to C
@ 2015-11-13 07:44 Michael Meskes <meskes@postgresql.org>
parent: Hiep Pham <hieppso194@gmail.com>
1 sibling, 0 replies; 3+ messages in thread
From: Michael Meskes @ 2015-11-13 07:44 UTC (permalink / raw)
To: pgsql-bugs; +Cc: Hiep Pham <hieppso194@gmail.com>
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?
You can use Embedded SQL for C, please check the docs.
Michael
--
Michael Meskes
Michael at Fam-Meskes dot De, Michael at Meskes dot (De|Com|Net|Org)
Meskes at (Debian|Postgresql) dot Org
Jabber: michael.meskes at gmail dot com
VfL Borussia! Força Barça! Go SF 49ers! Use Debian GNU/Linux, PostgreSQL
--
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs
^ permalink raw reply [nested|flat] 3+ messages in thread
end of thread, other threads:[~2015-11-13 07:44 UTC | newest]
Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2015-11-12 12:11 connect to C Hiep Pham <hieppso194@gmail.com>
2015-11-12 19:04 ` John R Pierce <pierce@hogranch.com>
2015-11-13 07:44 ` Michael Meskes <meskes@postgresql.org>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox