Re: longjmp in psql considered harmful

From: Martijn van Oosterhout <kleptog(at)svana(dot)org>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-hackers(at)postgreSQL(dot)org
Subject: Re: longjmp in psql considered harmful
Date: 2006-06-11 21:06:23
Message-ID: 20060611210623.GE20757@svana.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Sun, Jun 11, 2006 at 03:23:50PM -0400, Tom Lane wrote:
> Martijn van Oosterhout <kleptog(at)svana(dot)org> writes:
> > If you're asking me, yes. I use it a lot and would miss it if it were
> > gone. Is there another shortcut for "abort current command and don't
> > store in history but don't clear it from the screen"?
>
> Why are you expecting editing niceties (or history for that matter) when
> you're not using readline? This code isn't used if readline is enabled.

But the effect would change still, even with readline enabled. If
readline is compiled in and you press control-C, our handler is still
called. Currently, we siglongjmp out of readline() and start again. If
you only set a flag like proposed, we won't break out of the readline
call. readline will clear any partial state, but that's it.

It's been a long time since I wrote that patch, but I remember there
being a reason I left the siglongjmp() in, even with readline()
compiled in. I just can't remember what it was... it might have had
something to do with aborting input from files... I'll have to
experiment.

Have a nice day,
--
Martijn van Oosterhout <kleptog(at)svana(dot)org> http://svana.org/kleptog/
> From each according to his ability. To each according to his ability to litigate.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Marc G. Fournier 2006-06-11 21:34:46 Re: postgresql and process titles
Previous Message Alvaro Herrera 2006-06-11 20:36:11 Re: How to avoid transaction ID wrap