pg.ddx.io pgsql-admin@postgresql.org mailing list archive
help / color / mirror / Atom feedlibpqxx + postgresql connection
2+ messages / 2 participants
[nested] [flat]
* libpqxx + postgresql connection
@ 2006-08-01 10:44 LiveShell <liveshell@gmail.com>
0 siblings, 1 reply; 2+ messages in thread
From: LiveShell @ 2006-08-01 10:44 UTC (permalink / raw)
To: 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????
^ permalink raw reply [nested|flat] 2+ messages in thread
* Re: libpqxx + postgresql connection
@ 2006-08-01 11:23 Andy Shellam <andy.shellam-lists@mailnetwork.co.uk>
parent: LiveShell <liveshell@gmail.com>
0 siblings, 0 replies; 2+ messages in thread
From: Andy Shellam @ 2006-08-01 11:23 UTC (permalink / raw)
To: LiveShell <liveshell@gmail.com>; +Cc: pgsql-admin
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 <http://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!
^ permalink raw reply [nested|flat] 2+ messages in thread
end of thread, other threads:[~2006-08-01 11:23 UTC | newest]
Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2006-08-01 10:44 libpqxx + postgresql connection LiveShell <liveshell@gmail.com>
2006-08-01 11:23 ` Andy Shellam <andy.shellam-lists@mailnetwork.co.uk>
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