|
| 1 | +<REFENTRY ID="SQL-UNLISTEN"> |
| 2 | +<REFMETA> |
| 3 | +<REFENTRYTITLE> |
| 4 | +UNLISTEN |
| 5 | +</REFENTRYTITLE> |
| 6 | +<REFMISCINFO>SQL - Language Statements</REFMISCINFO> |
| 7 | +</REFMETA> |
| 8 | +<REFNAMEDIV> |
| 9 | +<REFNAME> |
| 10 | +UNLISTEN |
| 11 | +</REFNAME> |
| 12 | +<REFPURPOSE> |
| 13 | +Stop listening for notification on a notify condition |
| 14 | +</REFPURPOSE> |
| 15 | + |
| 16 | +<REFSYNOPSISDIV> |
| 17 | +<REFSYNOPSISDIVINFO> |
| 18 | +<DATE>1998-10-07</DATE> |
| 19 | +</REFSYNOPSISDIVINFO> |
| 20 | +<SYNOPSIS> |
| 21 | +UNLISTEN <REPLACEABLE CLASS="PARAMETER">notifyname</REPLACEABLE> | "*" |
| 22 | +</SYNOPSIS> |
| 23 | + |
| 24 | +<REFSECT2 ID="R2-SQL-UNLISTEN-1"> |
| 25 | +<REFSECT2INFO> |
| 26 | +<DATE>1998-10-07</DATE> |
| 27 | +</REFSECT2INFO> |
| 28 | +<TITLE> |
| 29 | +Inputs |
| 30 | +</TITLE> |
| 31 | +<PARA> |
| 32 | +</PARA> |
| 33 | +<VARIABLELIST> |
| 34 | +<VARLISTENTRY> |
| 35 | +<TERM> |
| 36 | +<REPLACEABLE CLASS="PARAMETER">notifyname</REPLACEABLE> |
| 37 | +</TERM> |
| 38 | +<LISTITEM> |
| 39 | +<PARA> |
| 40 | +Name of notify condition to stop listening to. |
| 41 | +If "*", all current listen registrations for this backend are cleared. |
| 42 | + |
| 43 | +</VARIABLELIST> |
| 44 | + |
| 45 | +</REFSECT2> |
| 46 | + |
| 47 | +<REFSECT2 ID="R2-SQL-UNLISTEN-2"> |
| 48 | +<REFSECT2INFO> |
| 49 | +<DATE>1998-10-07</DATE> |
| 50 | +</REFSECT2INFO> |
| 51 | +<TITLE> |
| 52 | +Outputs |
| 53 | +</TITLE> |
| 54 | +<PARA> |
| 55 | + |
| 56 | +<VARIABLELIST> |
| 57 | +<VARLISTENTRY> |
| 58 | +<TERM> |
| 59 | +<replaceable>status</replaceable> |
| 60 | +</TERM> |
| 61 | +<LISTITEM> |
| 62 | +<PARA> |
| 63 | +<VARIABLELIST> |
| 64 | +<VARLISTENTRY> |
| 65 | +<TERM> |
| 66 | +<returnvalue>UNLISTEN</returnvalue> |
| 67 | +</TERM> |
| 68 | +<LISTITEM> |
| 69 | +<PARA> |
| 70 | +Acknowledgement that statement has executed. |
| 71 | +</PARA> |
| 72 | +</LISTITEM> |
| 73 | +</VARLISTENTRY> |
| 74 | +</variablelist> |
| 75 | +</LISTITEM> |
| 76 | +</VARLISTENTRY> |
| 77 | +</VARIABLELIST> |
| 78 | +</REFSECT2> |
| 79 | +</REFSYNOPSISDIV> |
| 80 | + |
| 81 | +<REFSECT1 ID="R1-SQL-UNLISTEN-1"> |
| 82 | +<REFSECT1INFO> |
| 83 | +<DATE>1998-10-07</DATE> |
| 84 | +</REFSECT1INFO> |
| 85 | +<TITLE> |
| 86 | +Description |
| 87 | +</TITLE> |
| 88 | +<PARA> |
| 89 | +UNLISTEN cancels any existing registration of the current |
| 90 | +<productname>Postgres</productname> backend as a listener on the notify |
| 91 | +condition <REPLACEABLE CLASS="PARAMETER">notifyname</REPLACEABLE>. |
| 92 | +The special condition name "*" means to cancel all listener registrations |
| 93 | +for the current backend. |
| 94 | + |
| 95 | +<para> |
| 96 | +The backend does not complain if you UNLISTEN something you were not |
| 97 | +listening for. |
| 98 | + |
| 99 | +<para> |
| 100 | +Each backend will automatically execute <command>UNLISTEN "*"</command> when |
| 101 | +exiting. |
| 102 | + |
| 103 | +<para> |
| 104 | +The reference page for <command>NOTIFY</command> contains a more extensive |
| 105 | +discussion of the use of <command>LISTEN</command> and |
| 106 | +<command>NOTIFY</command>. |
| 107 | + |
| 108 | +<REFSECT1 ID="R1-SQL-UNLISTEN-2"> |
| 109 | +<TITLE> |
| 110 | +Usage |
| 111 | +</TITLE> |
| 112 | +<PARA> |
| 113 | +<ProgramListing> |
| 114 | +postgres=> listen virtual; |
| 115 | +LISTEN |
| 116 | +postgres=> notify virtual; |
| 117 | +NOTIFY |
| 118 | +ASYNC NOTIFY of 'virtual' from backend pid '12317' received |
| 119 | +postgres=> unlisten virtual; |
| 120 | +UNLISTEN |
| 121 | +postgres=> notify virtual; |
| 122 | +NOTIFY |
| 123 | +-- notice no NOTIFY event is received |
| 124 | +postgres=> |
| 125 | +</ProgramListing> |
| 126 | + |
| 127 | +</REFSECT1> |
| 128 | + |
| 129 | +<REFSECT1 ID="R1-SQL-UNLISTEN-3"> |
| 130 | +<TITLE> |
| 131 | +Compatibility |
| 132 | +</TITLE> |
| 133 | +<PARA> |
| 134 | + |
| 135 | +<REFSECT2 ID="R2-SQL-UNLISTEN-4"> |
| 136 | +<REFSECT2INFO> |
| 137 | +<DATE>1998-10-07</DATE> |
| 138 | +</REFSECT2INFO> |
| 139 | +<TITLE> |
| 140 | +SQL92 |
| 141 | +</TITLE> |
| 142 | +<PARA> |
| 143 | + There is no <command>UNLISTEN</command> in <acronym>SQL92</acronym>. |
| 144 | +</REFENTRY> |
0 commit comments