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

From Martijn van Oosterhout
Subject Re: [PATCH] Fix Ctrl-C related issues in psql (not for 8.1)
Date
Msg-id 20060614203241.GI4748@svana.org
Whole thread Raw
In response to Re: [PATCH] Fix Ctrl-C related issues in psql (not for 8.1)  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: [PATCH] Fix Ctrl-C related issues in psql (not for 8.1)
List pgsql-patches
On Wed, Jun 14, 2006 at 12:55:10PM -0400, Tom Lane wrote:
> 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?

Well, the obvious thing I can think of is that PQcancel also set a flag
in the PGconn structure which long-running functions (like lo_import)
in libpq could check.

If lo_import and lo_export are the only two functions that check that
flag, only they need to reset it. Although it probably wouldn't hurt to
reset it each query. I wouldn't worry about using it anywhere else in
libpq, since people seem to be ok with the current semantics.

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

Attachment

pgsql-patches by date:

Previous
From: Tom Lane
Date:
Subject: Re: SQL/XML publishing function experimental patch II
Next
From: Bruce Momjian
Date:
Subject: Re: COPY view