unlisten.sgml
上传用户:blenddy
上传日期:2007-01-07
资源大小:6495k
文件大小:3k
源码类别:

数据库系统

开发平台:

Unix_Linux

  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
  14. </REFPURPOSE>
  15. </refnamediv>
  16. <REFSYNOPSISDIV>
  17. <REFSYNOPSISDIVINFO>
  18. <DATE>1998-10-19</DATE>
  19. </REFSYNOPSISDIVINFO>
  20. <SYNOPSIS>
  21. UNLISTEN { <REPLACEABLE CLASS="PARAMETER">notifyname</REPLACEABLE> | * }
  22. </SYNOPSIS>
  23. <REFSECT2 ID="R2-SQL-UNLISTEN-1">
  24. <REFSECT2INFO>
  25. <DATE>1998-10-19</DATE>
  26. </REFSECT2INFO>
  27. <TITLE>
  28. Inputs
  29. </TITLE>
  30. <PARA>
  31. </PARA>
  32. <VARIABLELIST>
  33. <VARLISTENTRY>
  34. <TERM>
  35. <REPLACEABLE CLASS="PARAMETER">notifyname</REPLACEABLE>
  36. </TERM>
  37. <LISTITEM>
  38. <PARA>
  39. Name of previously registered notify condition.
  40. </para>
  41. </listitem>
  42. </varlistentry>
  43. <VARLISTENTRY>
  44. <TERM>
  45. <literal>*</literal>
  46. </TERM>
  47. <LISTITEM>
  48. <PARA>
  49. All current listen registrations for this backend are cleared.
  50. </para>
  51. </listitem>
  52. </varlistentry>
  53. </VARIABLELIST>
  54. </REFSECT2>
  55. <REFSECT2 ID="R2-SQL-UNLISTEN-2">
  56. <REFSECT2INFO>
  57. <DATE>1998-10-19</DATE>
  58. </REFSECT2INFO>
  59. <TITLE>
  60. Outputs
  61. </TITLE>
  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. </para>
  76. </REFSECT2>
  77. </REFSYNOPSISDIV>
  78. <REFSECT1 ID="R1-SQL-UNLISTEN-1">
  79. <REFSECT1INFO>
  80. <DATE>1998-10-19</DATE>
  81. </REFSECT1INFO>
  82. <TITLE>
  83. Description
  84. </TITLE>
  85. <PARA>
  86. <command>UNLISTEN</command>
  87. is used to remove an existing <command>NOTIFY</command> registration.
  88. UNLISTEN cancels any existing registration of the current
  89. <productname>Postgres</productname> session as a listener on the notify
  90. condition <REPLACEABLE CLASS="PARAMETER">notifyname</REPLACEABLE>.
  91. The special condition wildcard "*" cancels all listener registrations
  92. for the current session.
  93. </para>
  94. <para>
  95. <xref linkend="sql-notify" endterm="sql-notify-ref">
  96. contains a more extensive
  97. discussion of the use of <command>LISTEN</command> and
  98. <command>NOTIFY</command>.
  99. </para>
  100. <REFSECT2 ID="R2-SQL-UNLISTEN-3">
  101. <REFSECT2INFO>
  102. <DATE>1998-10-19</DATE>
  103. </REFSECT2INFO>
  104. <TITLE>
  105. Notes
  106. </TITLE>
  107. <para>
  108. <REPLACEABLE CLASS="PARAMETER">classname</REPLACEABLE>
  109. needs not to be a valid class name but can be any string valid
  110. as a name up to 32 characters long.
  111. </para>
  112. <para>
  113. The backend does not complain if you UNLISTEN something you were not
  114. listening for.
  115. Each backend will automatically execute <command>UNLISTEN *</command> when
  116. exiting.
  117. </para>
  118. <para>
  119. A restriction in some previous releases of
  120.  <productname>Postgres</productname> that a
  121. <REPLACEABLE CLASS="PARAMETER">classname</REPLACEABLE>
  122. which does not correspond to an actual table must be enclosed in double-quotes
  123. is no longer present.
  124. </para>
  125. </REFSECT2>
  126. </refsect1>
  127. <REFSECT1 ID="R1-SQL-UNLISTEN-2">
  128. <TITLE>
  129. Usage
  130. </TITLE>
  131. <para>
  132. <programlisting>
  133. postgres=> LISTEN virtual;
  134. LISTEN
  135. postgres=> NOTIFY virtual;
  136. NOTIFY
  137. ASYNC NOTIFY of 'virtual' from backend pid '12317' received
  138. </programlisting>
  139. <programlisting>
  140. postgres=> UNLISTEN virtual;
  141. UNLISTEN
  142. postgres=> NOTIFY virtual;
  143. NOTIFY
  144. -- notice no NOTIFY event is received
  145. postgres=>
  146. </programlisting>
  147. </para>
  148. </REFSECT1>
  149. <REFSECT1 ID="R1-SQL-UNLISTEN-3">
  150. <TITLE>
  151. Compatibility
  152. </TITLE>
  153. <REFSECT2 ID="R2-SQL-UNLISTEN-4">
  154. <REFSECT2INFO>
  155. <DATE>1998-10-19</DATE>
  156. </REFSECT2INFO>
  157. <TITLE>
  158. SQL92
  159. </TITLE>
  160. <PARA>
  161.    There is no <command>UNLISTEN</command> in <acronym>SQL92</acronym>.
  162. </para>
  163. </refsect2>
  164. </refsect1>
  165. </REFENTRY>