Re: [HACKERS] psql and Control-C
Peter Eisentraut <e99re41@docs.uu.se>
From: Peter Eisentraut <e99re41@DoCS.UU.SE>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: chris@bitmead.com, PostgreSQL Development <pgsql-hackers@postgreSQL.org>
Date: 2000-02-18T14:19:07Z
Lists: 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