Re: psql query gets stuck indefinitely - Mailing list pgsql-general

From Craig Ringer
Subject Re: psql query gets stuck indefinitely
Date
Msg-id 4ED441CA.8050800@ringerc.id.au
Whole thread Raw
In response to psql query gets stuck indefinitely  (tamanna madaan <tamanna.madaan@globallogic.com>)
List pgsql-general
 On 11/28/2011 05:30 PM, tamanna madaan wrote:
Hi All
 
I have postgres installed in cluster setup. My system has a script  which executes the below query on remote system in cluster.
 
psql -t -q -Uslon -h<hostip> -d<dbname> -c"select 1;"
 
But somehow this query got stuck. It didnt return even after the remote system( on which this query was supposed to execute) is rebooted . What could be the reason ??


The issue will most likely be related to the network or to the client-side host. Perhaps the client machine changed IP addresses (maybe as part of a switch from WiFi to wired or similar) ?

Check the man page for psql in 9.1; I think client-side keepalive support got committed for 9.1 . If it didn't, you can always set it globally for all TCP/IP connections on your system. See eg http://tldp.org/HOWTO/TCP-Keepalive-HOWTO/usingkeepalive.html .

--
Craig Ringer

pgsql-general by date:

Previous
From: panam
Date:
Subject: Extending the volume size of the data directory volume
Next
From: Craig Ringer
Date:
Subject: Re: psql query gets stuck indefinitely