mirror of
https://github.com/postgres/postgres.git
synced 2025-11-24 00:23:06 +03:00
Making PQrequestCancel safe to call in a signal handler turned out to be
much easier than I feared. So here are the diffs.
Some notes:
* I modified the postmaster's packet "iodone" callback interface to allow
the callback routine to return a continue-or-drop-connection return
code; this was necessary to allow the connection to be closed after
receiving a Cancel, rather than proceeding to launch a new backend...
Being a neatnik, I also made the iodone proc have a typechecked
parameter list.
* I deleted all code I could find that had to do with OOB.
* I made some edits to ensure that all signals mentioned in the code
are referred to symbolically not by numbers ("SIGUSR2" not "2").
I think Bruce may have already done at least some of the same edits;
I hope that merging these patches is not too painful.
43 lines
1.2 KiB
Plaintext
43 lines
1.2 KiB
Plaintext
.\" This is -*-nroff-*-
|
|
.\" XXX standard disclaimer belongs here....
|
|
.\" $Header: /cvsroot/pgsql/src/man/Attic/listen.l,v 1.7 1998/07/09 03:29:09 scrappy Exp $
|
|
.TH "LISTEN" SQL 03/12/94 PostgreSQL PostgreSQL
|
|
.SH NAME
|
|
listen - listen for notification on a relation
|
|
.SH SYNOPSIS
|
|
.nf
|
|
\fBlisten\fR class_name
|
|
.fi
|
|
.SH DESCRIPTION
|
|
.BR listen
|
|
is used to register the current backend as a listener on the relation
|
|
.IR class_name .
|
|
When the command
|
|
.BI notify " class_name"
|
|
is called either from within a rule or at the query level, the
|
|
frontend applications corresponding to the listening backends
|
|
are notified. When the backend process exits, this registration
|
|
is cleared.
|
|
.PP
|
|
This event notification is performed through the Libpq protocol
|
|
and frontend application interface. The application program
|
|
must call the routine
|
|
.IR PQnotifies
|
|
in order to find out the name of the class to which a given
|
|
notification corresponds. If this code is not included in
|
|
the application, the event notification will be queued and
|
|
never be processed.
|
|
.SH "SEE ALSO"
|
|
create_rule(l),
|
|
notify(l),
|
|
select(l),
|
|
libpq.
|
|
.SH BUGS
|
|
There is no way to un-\c
|
|
.BR listen
|
|
except to drop the connection (i.e., restart the backend server).
|
|
.PP
|
|
The
|
|
.IR psql(1)
|
|
command does not poll for asynchronous events.
|