<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Connection to Postgresql from C  or C++ program in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/connection-to-postgresql-from-c-or-c-program/m-p/3387838#M714052</link>
    <description>I am trying to connect to a Postgresql database from either C or C++ program.I have a HP-UX 11.23i (Itanium Processor ,64 bit),ia64,rx2600.&lt;BR /&gt;&lt;BR /&gt;I get a compiler error when I compile. I am using libpg-fe.h.Is there a Library Path I am supposed to set and where should it point to.I am using the following program.Is there any other way to connect to databases in C or C++&lt;BR /&gt;&lt;BR /&gt;Error:- &lt;BR /&gt;&lt;BR /&gt;$ cc testpg.c&lt;BR /&gt;ld: Unsatisfied symbol "PQconnectdb" in file testpg.o&lt;BR /&gt;1 errors.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;#include&lt;STDIO.H&gt;&lt;BR /&gt;#include&lt;STDLIB.H&gt;&lt;BR /&gt;#include&lt;LIBPQ-FE.H&gt;&lt;BR /&gt;int main() {&lt;BR /&gt;  printf( "Hello World");&lt;BR /&gt;  PGconn *conn;&lt;BR /&gt;  const char *connection_str= "host=localhost user=postgres password=postgres dbname=mdpdb";&lt;BR /&gt;  conn= PQconnectdb(connection_str);&lt;BR /&gt;/*  if (PQstatus(conn) == CONNECTION_BAD ) {&lt;BR /&gt;   fprintf(stderr,"Connection to %s failed,%s",connection_str,PQerrorMessage(conn));&lt;BR /&gt;  } &lt;BR /&gt;   else { printf("Connected OK\n");&lt;BR /&gt;   }&lt;BR /&gt;   PQfinish(conn); */&lt;BR /&gt;   return EXIT_SUCCESS;&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Help Appreciated &lt;BR /&gt;Thank you very much,&lt;BR /&gt;Vinay&lt;BR /&gt;program is attached.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/LIBPQ-FE.H&gt;&lt;/STDLIB.H&gt;&lt;/STDIO.H&gt;</description>
    <pubDate>Mon, 27 Sep 2004 12:33:56 GMT</pubDate>
    <dc:creator>Vinay_19</dc:creator>
    <dc:date>2004-09-27T12:33:56Z</dc:date>
    <item>
      <title>Connection to Postgresql from C  or C++ program</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/connection-to-postgresql-from-c-or-c-program/m-p/3387838#M714052</link>
      <description>I am trying to connect to a Postgresql database from either C or C++ program.I have a HP-UX 11.23i (Itanium Processor ,64 bit),ia64,rx2600.&lt;BR /&gt;&lt;BR /&gt;I get a compiler error when I compile. I am using libpg-fe.h.Is there a Library Path I am supposed to set and where should it point to.I am using the following program.Is there any other way to connect to databases in C or C++&lt;BR /&gt;&lt;BR /&gt;Error:- &lt;BR /&gt;&lt;BR /&gt;$ cc testpg.c&lt;BR /&gt;ld: Unsatisfied symbol "PQconnectdb" in file testpg.o&lt;BR /&gt;1 errors.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;#include&lt;STDIO.H&gt;&lt;BR /&gt;#include&lt;STDLIB.H&gt;&lt;BR /&gt;#include&lt;LIBPQ-FE.H&gt;&lt;BR /&gt;int main() {&lt;BR /&gt;  printf( "Hello World");&lt;BR /&gt;  PGconn *conn;&lt;BR /&gt;  const char *connection_str= "host=localhost user=postgres password=postgres dbname=mdpdb";&lt;BR /&gt;  conn= PQconnectdb(connection_str);&lt;BR /&gt;/*  if (PQstatus(conn) == CONNECTION_BAD ) {&lt;BR /&gt;   fprintf(stderr,"Connection to %s failed,%s",connection_str,PQerrorMessage(conn));&lt;BR /&gt;  } &lt;BR /&gt;   else { printf("Connected OK\n");&lt;BR /&gt;   }&lt;BR /&gt;   PQfinish(conn); */&lt;BR /&gt;   return EXIT_SUCCESS;&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Help Appreciated &lt;BR /&gt;Thank you very much,&lt;BR /&gt;Vinay&lt;BR /&gt;program is attached.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/LIBPQ-FE.H&gt;&lt;/STDLIB.H&gt;&lt;/STDIO.H&gt;</description>
      <pubDate>Mon, 27 Sep 2004 12:33:56 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/connection-to-postgresql-from-c-or-c-program/m-p/3387838#M714052</guid>
      <dc:creator>Vinay_19</dc:creator>
      <dc:date>2004-09-27T12:33:56Z</dc:date>
    </item>
    <item>
      <title>Re: Connection to Postgresql from C  or C++ program</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/connection-to-postgresql-from-c-or-c-program/m-p/3387839#M714053</link>
      <description>I connect this way (postgresql to SuSE linux; HPUX is probably very similar) :&lt;BR /&gt;&lt;BR /&gt;a) environment variables :&lt;BR /&gt;export LD_RUN_PATH=/usr/local/pgsql/bin&lt;BR /&gt;export LD_LIBRARY_PATH=/usr/local/pgsql/lib&lt;BR /&gt;export PATH=/usr/loacal/pgsql/bin:$PATH&lt;BR /&gt;&lt;BR /&gt;b) precompile&lt;BR /&gt;ecpg prog.pgc&lt;BR /&gt;&lt;BR /&gt;c) compile+link&lt;BR /&gt;cc -I/usr/local/pgsql/include -c prog.c&lt;BR /&gt;cc -o prog.r prog.o -L/usr/local/pgsql/lib -lecpg&lt;BR /&gt;&lt;BR /&gt;Werner</description>
      <pubDate>Mon, 27 Sep 2004 23:51:43 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/connection-to-postgresql-from-c-or-c-program/m-p/3387839#M714053</guid>
      <dc:creator>Werner Ittner</dc:creator>
      <dc:date>2004-09-27T23:51:43Z</dc:date>
    </item>
    <item>
      <title>Re: Connection to Postgresql from C  or C++ program</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/connection-to-postgresql-from-c-or-c-program/m-p/3387840#M714054</link>
      <description>That worked great on HP-UX too. and also worked great on Suse Linix 7.3&lt;BR /&gt;&lt;BR /&gt;Thank you Werner</description>
      <pubDate>Tue, 28 Sep 2004 22:01:12 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/connection-to-postgresql-from-c-or-c-program/m-p/3387840#M714054</guid>
      <dc:creator>Vinay_19</dc:creator>
      <dc:date>2004-09-28T22:01:12Z</dc:date>
    </item>
  </channel>
</rss>

