Re: [HACKERS] psql and Control-C

From: Chris Bitmead <chrisb(at)nimrod(dot)itg(dot)telstra(dot)com(dot)au>
To: PostgreSQL Development <pgsql-hackers(at)postgreSQL(dot)org>
Subject: Re: [HACKERS] psql and Control-C
Date: 2000-02-18 06:06:48
Message-ID: 38ACE178.40AB502A@nimrod.itg.telecom.com.au
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Tom Lane wrote:

> 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?

This is actually the gnu history library. Currently psql issues a save
command when you exit or when you enter \s. I'm not sure why gnu
history appears to require you to write the whole history at once
rather than appending to a file but anyway...

A better way of doing it might be to have psql's finishInput() passed
to atexit(), just to make sure it's always called, and have
signal handlers in place for *every* signal whose handlers call exit(),
so finishing up is done neatly.

It might even be worthwhile to write the history after every command.

BTW, is it necessary to print "\q" when you hit ctrl-d ? Seems just a
little tacky to me.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message root 2000-02-18 08:20:48 Large object problem in 6.5.2 & 3
Previous Message Tom Lane 2000-02-18 06:00:49 Re: [HACKERS] queries on 2+ indices