Re: [HACKERS] psql and Control-C - Mailing list pgsql-hackers

From Peter Eisentraut
Subject Re: [HACKERS] psql and Control-C
Date
Msg-id Pine.GSO.4.02A.10002181516500.4777-100000@Krokodil.DoCS.UU.SE
Whole thread Raw
In response to Re: [HACKERS] psql and Control-C  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: [HACKERS] psql and Control-C
List pgsql-hackers
On Fri, 18 Feb 2000, Tom Lane wrote:

> However, there is some chance of screwing up libreadline --- I don't
> know enough about its innards to know if it can survive losing
> control at a random point.  If we can confine the region where longjmp
> will be attempted to just the point where the program is blocked
> waiting for user input, it'd probably be pretty safe.

Readline has an official way to preempt is, namely setting rl_done to
non-zero. I can take a look how it copes with a longjmp from a signal
handler, but I wouldn't set my hopes too high.

> Something I've noticed that might or might not be related to this
> issue is that if psql exits due to backend crash, it fails to save the
> last few lines of command history into the history file.  Not closing
> down libreadline, maybe?

As someone else pointed out, I might as well move write_history() into an
atexit hook.

-- 
Peter Eisentraut                  Sernanders vaeg 10:115
peter_e@gmx.net                   75262 Uppsala
http://yi.org/peter-e/            Sweden



pgsql-hackers by date:

Previous
From: Peter Eisentraut
Date:
Subject: Re: [HACKERS] psql and Control-C
Next
From: Peter Eisentraut
Date:
Subject: Re: [HACKERS] psql and Control-C