Re: [GENERAL] libpq - prevent automatic reconnect

2012-12-07 Thread Mark Morgan Lloyd
Chris Angelico wrote: On Thu, Dec 6, 2012 at 5:56 AM, Tom Lane wrote: I suspect this action isn't dropping the TCP connection. It's only equivalent to a momentary glitch in your network connectivity --- and you'd be very unhappy if that caused TCP connections to go down, because networks have

Re: [GENERAL] libpq - prevent automatic reconnect

2012-12-06 Thread Chris Angelico
On Thu, Dec 6, 2012 at 5:56 AM, Tom Lane wrote: > I suspect this action isn't dropping the TCP connection. It's only > equivalent to a momentary glitch in your network connectivity --- and > you'd be very unhappy if that caused TCP connections to go down, because > networks have glitches all the

Re: [GENERAL] libpq - prevent automatic reconnect

2012-12-05 Thread Tom Lane
icholy writes: > libpq will automatically reconnect if the connection is dropped. No it won't. You'd have to do a PQreset() to make that happen. > auto con = PQconnectdb("info");while (true) {PQclear(PQexec(con, > "SELECT * FROM foo LIMIT 1")); > std::this_thread::sleep_for(std::ch

[GENERAL] libpq - prevent automatic reconnect

2012-12-05 Thread icholy
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 do