libpq - prevent automatic reconnect

From: icholy <ilia(dot)choly(at)gmail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: libpq - prevent automatic reconnect
Date: 2012-12-05 18:05:24
Message-ID: 1354730724609-5735271.post@n5.nabble.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

libpq will automatically reconnect if the connection is dropped.
auto con = PQconnectdb("info"); while (true) { PQclear(PQexec(con,
"SELECT * FROM foo LIMIT 1"));
std::this_thread::sleep_for(std::chrono::seconds(1)); std::cout << "here
" << i++ << std::endl; }
$ sudo ifconfig eth0 down
output stops
$ sudo ifconfig eht0 up
output resumes
is there a way to disable this behaviour?

--
View this message in context: http://postgresql.1045698.n5.nabble.com/libpq-prevent-automatic-reconnect-tp5735271.html
Sent from the PostgreSQL - general mailing list archive at Nabble.com.

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Jeff Janes 2012-12-05 18:21:03 Re: how do I grant select to one user for all tables in a DB?
Previous Message Jeff Janes 2012-12-05 18:01:31 Re: Corrupt indexes on slave when using pg_bulkload on master