libpqxx + postgresql connection

From: LiveShell <liveshell(at)gmail(dot)com>
To: pgsql-admin(at)postgresql(dot)org
Subject: libpqxx + postgresql connection
Date: 2006-08-01 10:44:44
Message-ID: 928fe9b50608010344q5481f1c2sd31c29607fae52d2@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

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????

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Andy Shellam 2006-08-01 11:23:22 Re: libpqxx + postgresql connection
Previous Message Shoaib Mir 2006-08-01 08:36:46 Re: how to increase performance of Postgre