User Tools

Site Tools


programming:c:libpq

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
programming:c:libpq [2018-02-07 23:02] – [Linking] add requirements zlgprogramming:c:libpq [2018-07-03 01:00] (current) – external edit 127.0.0.1
Line 1: Line 1:
 +====== PostgreSQL with libpq ======
 +
 ''libpq'' is the frontend API for PostgreSQL, written in C. Upstream has fantastic [[https://www.postgresql.org/docs/current/static/|documentation]], but the workflows aren't obvious unless you've used other database APIs like PHP's ''PDO'' class or the ''sqlite'' module in Python. This page will outline a few common tasks and how to do them. ''libpq'' is the frontend API for PostgreSQL, written in C. Upstream has fantastic [[https://www.postgresql.org/docs/current/static/|documentation]], but the workflows aren't obvious unless you've used other database APIs like PHP's ''PDO'' class or the ''sqlite'' module in Python. This page will outline a few common tasks and how to do them.
  
Line 23: Line 25:
  
 int main(int argc, char **argv) { int main(int argc, char **argv) {
 +    // create what we need to connect: the db connection structure and its options
     PGconn *conn;     PGconn *conn;
     const char *dbopts;     const char *dbopts;
programming/c/libpq.1518044552.txt.gz · Last modified: 2018-07-03 01:00 (external edit)