libpq - prevent automatic reconnect - Mailing list pgsql-general

From icholy
Subject libpq - prevent automatic reconnect
Date
Msg-id 1354730724609-5735271.post@n5.nabble.com
Whole thread Raw
Responses Re: libpq - prevent automatic reconnect  (Tom Lane <tgl@sss.pgh.pa.us>)
List 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: libpq - prevent automatic reconnect
Sent from the PostgreSQL - general mailing list archive at Nabble.com.

pgsql-general by date:

Previous
From: Jeff Janes
Date:
Subject: Re: Corrupt indexes on slave when using pg_bulkload on master
Next
From: Jeff Janes
Date:
Subject: Re: how do I grant select to one user for all tables in a DB?