X-Original-To: pgsql-admin-postgresql.org@postgresql.org Received: from localhost (mx1.hub.org [200.46.208.251]) by postgresql.org (Postfix) with ESMTP id 56F919FA430 for ; Tue, 1 Aug 2006 08:43:11 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) with ESMTP id 43327-06 for ; Tue, 1 Aug 2006 08:43:06 -0300 (ADT) X-Greylist: delayed 00:19:31.909538 by SQLgrey- Received: from svr4.postgresql.org (svr4.postgresql.org [66.98.251.159]) by postgresql.org (Postfix) with ESMTP id D80019FB1C3 for ; Tue, 1 Aug 2006 08:43:06 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.3 Received: from sydney.mailnetwork.co.uk (server88-208-192-113.live-servers.net [88.208.192.113]) by svr4.postgresql.org (Postfix) with ESMTP id 6614F5AFB3A for ; Tue, 1 Aug 2006 11:23:33 +0000 (GMT) Received: from andyshellam-gw.adsl.newnet.co.uk ([80.175.198.137]:33432 helo=[192.168.1.15]) by sydney.mailnetwork.co.uk with esmtpa (Exim 4.60) (envelope-from ) id 1G7sLR-0004Iv-TH; Tue, 01 Aug 2006 12:23:30 +0100 Message-ID: <44CF39AA.1020900@mailnetwork.co.uk> Date: Tue, 01 Aug 2006 12:23:22 +0100 From: Andy Shellam Reply-To: Andy Shellam Organization: The Mail Network User-Agent: Thunderbird 1.5.0.5 (X11/20060719) MIME-Version: 1.0 To: LiveShell Cc: pgsql-admin@postgresql.org Subject: Re: libpqxx + postgresql connection References: <928fe9b50608010344q5481f1c2sd31c29607fae52d2@mail.gmail.com> In-Reply-To: <928fe9b50608010344q5481f1c2sd31c29607fae52d2@mail.gmail.com> Content-Type: multipart/alternative; boundary="------------010502050108010405040002" X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=1.829 tagged_above=0 required=5 tests=FORGED_RCVD_HELO, HTML_50_60, HTML_MESSAGE, NORMAL_HTTP_TO_IP, SPF_SOFTFAIL X-Spam-Level: * X-Archive-Number: 200608/6 X-Sequence-Number: 22550 This is a multi-part message in MIME format. --------------010502050108010405040002 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit You might be better off asking this on the pgsql-interfaces list - that's geared more towards programming with libpq and other interfaces. Andy. LiveShell wrote: > Hi all, > I am using libpqxx to connct to Pgsql database. > Following is my code in a connect method of a class > > try > { > conninfo = "host=127.0.0.1 dbname = > DatabaseName user=uname"; > conn = new connection(conninfo); > > } > catch (const sql_error &roSqlQueryError) > { > printf("In Error \n"); > string szQueryError = roSqlQueryError.what(); > szQueryError += "Query was:: "; > szQueryError += roSqlQueryError.query(); > throw runtime_error(szQueryError); > } > > But when i use this connection in later stage it results to > segmentation fault. > > I changed database name to wrong dbname (non existing database) then > also it doesnt go to catch staatement... > > Can ny body tell me what is teh problem with this???? > > !DSPAM:37,44cf30d8143291881918933! --------------010502050108010405040002 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit You might be better off asking this on the pgsql-interfaces list - that's geared more towards programming with libpq and other interfaces.

Andy.

LiveShell wrote:
Hi all,
              I am using libpqxx to connct to Pgsql database. Following is my code in a connect method of a class
 
try
 {
      conninfo = "host=127.0.0.1 dbname = DatabaseName user=uname";
       conn = new connection(conninfo);

}
 catch (const sql_error &roSqlQueryError)
   {
        printf("In Error \n"); 
        string szQueryError = roSqlQueryError.what();
           szQueryError += "Query was:: ";
           szQueryError += roSqlQueryError.query();
           throw runtime_error(szQueryError);
  }

But when i use this connection in later stage it results to segmentation fault.

I changed database name to wrong dbname (non existing database) then also it doesnt go to catch staatement...

Can ny body tell me what is teh problem with this????

!DSPAM:37,44cf30d8143291881918933!

--------------010502050108010405040002--