mirror of
https://github.com/postgres/postgres.git
synced 2025-11-21 00:42:43 +03:00
Invent a new, more thread-safe version of PQrequestCancel, called PQcancel.
Use this new function in psql. Implement query cancellation in psql for Windows. Code by Magnus Hagander, documentation and minor editorialization by Tom Lane.
This commit is contained in:
@@ -12,7 +12,7 @@
|
||||
* Portions Copyright (c) 1996-2004, PostgreSQL Global Development Group
|
||||
* Portions Copyright (c) 1994, Regents of the University of California
|
||||
*
|
||||
* $PostgreSQL: pgsql/src/interfaces/libpq/libpq-int.h,v 1.95 2004/10/18 22:00:42 tgl Exp $
|
||||
* $PostgreSQL: pgsql/src/interfaces/libpq/libpq-int.h,v 1.96 2004/10/30 23:11:27 tgl Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -346,6 +346,18 @@ struct pg_conn
|
||||
PQExpBufferData workBuffer; /* expansible string */
|
||||
};
|
||||
|
||||
/* PGcancel stores all data necessary to cancel a connection. A copy of this
|
||||
* data is required to safely cancel a connection running on a different
|
||||
* thread.
|
||||
*/
|
||||
struct pg_cancel
|
||||
{
|
||||
SockAddr raddr; /* Remote address */
|
||||
int be_pid; /* PID of backend --- needed for cancels */
|
||||
int be_key; /* key of backend --- needed for cancels */
|
||||
};
|
||||
|
||||
|
||||
/* String descriptions of the ExecStatusTypes.
|
||||
* direct use of this array is deprecated; call PQresStatus() instead.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user