Re: [HACKERS] Proposal for async support in libpq - Mailing list pgsql-hackers

From Bruce Momjian
Subject Re: [HACKERS] Proposal for async support in libpq
Date
Msg-id 199804180513.BAA06961@candle.pha.pa.us
Whole thread Raw
In response to Re: [HACKERS] Proposal for async support in libpq  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: [HACKERS] Proposal for async support in libpq
Re: [HACKERS] Proposal for async support in libpq
List pgsql-hackers
>
> Bruce Momjian <maillist@candle.pha.pa.us> writes:
> > This all looks good.  Another thing we really need it to be able to
> > cancel queries.  This would be a big win, and looks like it could fit
> > into the scheme here.
>
> I thought about proposing a PQcancelAsync that would cancel the active
> query-in-progress.  But that would require support on the backend side,
> and I am far from competent to make it happen.  (libpq is simple enough
> that I'm not afraid to rewrite it, but making major mods to the backend
> is another story.  I just got here this week...)

In backend/libpq/pqcomm.c, I see pg_sendoob() which sends out-of-band
data FROM the backend TO the client, but it is not called from anywhere.

This could be a method of signaling that a notification was pending, and
sending out-of-band data FROm the client TO the backend could be used
for cancelling a query.

out-of-band data causes a convenient signal to the process on the other
end, which can easily be used to handle these cases.

--
Bruce Momjian                          |  830 Blythe Avenue
maillist@candle.pha.pa.us              |  Drexel Hill, Pennsylvania 19026
  +  If your life is a hard drive,     |  (610) 353-9879(w)
  +  Christ can be your backup.        |  (610) 853-3000(h)

pgsql-hackers by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: [HACKERS] Proposal for async support in libpq
Next
From: Phil Thompson
Date:
Subject: Re: [HACKERS] Proposal for async support in libpq