Skip site navigation (1) Skip section navigation (2)

Re: Psql or test application hangs when interface is down for the DB server

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "K, Niranjan (NSN - IN/Bangalore)" <niranjan(dot)k(at)nsn(dot)com>
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: Psql or test application hangs when interface is down for the DB server
Date: 2008-07-15 14:45:53
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-bugs
"K, Niranjan (NSN - IN/Bangalore)" <niranjan(dot)k(at)nsn(dot)com> writes:
> In the postgres database there is table 'COUNTER_TABLE' with column
> integer type 'COUNTER'. The test application attached in this mail, will
> start a transaction, gets the current value in the COUNTER, increments
> the value and updates the incremented value into the COUNTER column.
> This is being done in a loop. The program is started in a remote client
> and after few transactions, the interface between the client & the
> database server is brought down (example I used "ifconfig eth0 down" in
> the server). With this the test application hangs and does not return
> from the API of postgres (ex. 'PQexec').

If you waited long enough for the TCP connection to time out, it would
return (with an error, of course).  This behavior is not a bug, it is
the expected behavior of any program using a network connection.

			regards, tom lane

In response to


pgsql-bugs by date

Next:From: Oskars OzolsDate: 2008-07-15 19:24:57
Subject: BUG #4307: INSERT fails with primary key contraint
Previous:From: Bruce MomjianDate: 2008-07-15 14:22:02
Subject: Re: BUG #4186: set lc_messages does not work

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group