Discussion:
[Libpqxx-general] Timeouts in libpqxx API
Ganesh Sangle
2011-08-19 23:22:04 UTC
Permalink
Hello all,
I have recently started using libpqxx to connect to postgres.
On one of my heavily loaded VMs, when my client executes some SQL queries
and alterations, its stuck there for large amounts of time. In one case, the
call did not return at all even after 7 hours.
Eventually though, postgres complained that its shared_buffers werent enough
for it to work.
I would like to know if there is a way to have timebounds specified for
libpqxx APIs ? For instance,

nontransaction drop_table(*conn);
try {
drop_table.exec(drop_stmt); << This does not return for long time.
} catch (const std::exception &ex )
{
log_exception(ex);
}

It seems to me that this could be a problem with the server as well.

Any ideas how to make it a timebound statement ?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.pgfoundry.org/pipermail/libpqxx-general/attachments/20110819/44b1e48d/attachment.html>
Jeroen Vermeulen
2011-08-20 05:32:23 UTC
Permalink
Post by Ganesh Sangle
I would like to know if there is a way to have timebounds specified for
libpqxx APIs ? For instance,
nontransaction drop_table(*conn);
try {
drop_table.exec(drop_stmt); << This does not return for long time.
} catch (const std::exception &ex )
{
log_exception(ex);
}
Set the statement_timeout variable:

http://www.postgresql.org/docs/9.0/interactive/runtime-config-client.html#RUNTIME-CONFIG-CLIENT-STATEMENT


Jeroen

Loading...