psql sets up cancel handler very early - Mailing list pgsql-hackers

From Peter Eisentraut
Subject psql sets up cancel handler very early
Date
Msg-id 519259C8.6060401@gmx.net
Whole thread Raw
Responses Re: psql sets up cancel handler very early  (Ryan Kelly <rpkelly22@gmail.com>)
Re: psql sets up cancel handler very early  (Dean Rasheed <dean.a.rasheed@gmail.com>)
List pgsql-hackers
Sometimes, the psql startup hangs when it cannot resolve or connect to a
host.  Intuitively, I would like to press Ctrl+C and correct the
connection string or investigate.  But that doesn't work because Ctrl+C
is already bound to the query cancel handler by that time.

It seems to me that there is no point in setting up the cancel handler
before the database connection is established.  Example patch attached.
 Comments?

Attachment

pgsql-hackers by date:

Previous
From: Heikki Linnakangas
Date:
Subject: Re: streaming replication, "frozen snapshot backup on it" and missing relfile (postgres 9.2.3 on xfs + LVM)
Next
From: Heikki Linnakangas
Date:
Subject: Re: commit fest schedule for 9.4