Skip site navigation (1) Skip section navigation (2)

Re: [PATCH] Fix Ctrl-C related issues in psql (not for 8.1)

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Martijn van Oosterhout <kleptog(at)svana(dot)org>
Cc: pgsql-patches(at)postgresql(dot)org
Subject: Re: [PATCH] Fix Ctrl-C related issues in psql (not for 8.1)
Date: 2006-06-14 16:55:10
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-patches
Martijn van Oosterhout <kleptog(at)svana(dot)org> writes:
> As anyone who has been following -hackers knows, there's been a bit of
> discussion about how psql should deal with ^C and pagers. Attached is a
> patch that deals with all the memory leak and descriptor leak issues.
> With this patch, even valgrind can't find any leaked memory (except a
> few things from program startup). With this patch, I find psql a
> pleasure to use, it doesn't bug me at all anymore.

I've applied a modified form of this patch that also tries to clean up
the behavior for COPY and large-object operations.  Please redo whatever
testing you did before and make sure I didn't break it.

I'm not totally satisfied with the large-object fix yet; sometimes you
have to hit control-C quite a few times before you manage to abort a
long-running \lo_import or \lo_export.  This is because the QueryCancel
request does nothing if it arrives at the backend between lowrite() or
loread() function calls.  The only obvious fix is to duplicate libpq's
lo_import() and lo_export() functions into psql so that we can add
cancel_pressed checks into their loops (obviously libpq itself can't
check that).  Which is kinda yucky.  Any thoughts?

			regards, tom lane

In response to


pgsql-patches by date

Next:From: Bruce MomjianDate: 2006-06-14 17:39:23
Subject: Re: Free WAL caches on switching segments
Previous:From: Bruce MomjianDate: 2006-06-14 13:18:31

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group