gooderp18绿色标准版
Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

141 line
14KB

  1. <?xml version="1.0" encoding="UTF-8" standalone="no"?>
  2. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>ALTER EXTENSION</title><link rel="stylesheet" type="text/css" href="stylesheet.css" /><link rev="made" href="pgsql-docs@lists.postgresql.org" /><meta name="generator" content="DocBook XSL Stylesheets V1.79.1" /><link rel="prev" href="sql-altereventtrigger.html" title="ALTER EVENT TRIGGER" /><link rel="next" href="sql-alterforeigndatawrapper.html" title="ALTER FOREIGN DATA WRAPPER" /></head><body><div xmlns="http://www.w3.org/TR/xhtml1/transitional" class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="5" align="center">ALTER EXTENSION</th></tr><tr><td width="10%" align="left"><a accesskey="p" href="sql-altereventtrigger.html" title="ALTER EVENT TRIGGER">Prev</a> </td><td width="10%" align="left"><a accesskey="u" href="sql-commands.html" title="SQL Commands">Up</a></td><th width="60%" align="center">SQL Commands</th><td width="10%" align="right"><a accesskey="h" href="index.html" title="PostgreSQL 12.4 Documentation">Home</a></td><td width="10%" align="right"> <a accesskey="n" href="sql-alterforeigndatawrapper.html" title="ALTER FOREIGN DATA WRAPPER">Next</a></td></tr></table><hr></hr></div><div class="refentry" id="SQL-ALTEREXTENSION"><div class="titlepage"></div><a id="id-1.9.3.11.1" class="indexterm"></a><div class="refnamediv"><h2><span class="refentrytitle">ALTER EXTENSION</span></h2><p>ALTER EXTENSION —
  3. change the definition of an extension
  4. </p></div><div class="refsynopsisdiv"><h2>Synopsis</h2><pre class="synopsis">
  5. ALTER EXTENSION <em class="replaceable"><code>name</code></em> UPDATE [ TO <em class="replaceable"><code>new_version</code></em> ]
  6. ALTER EXTENSION <em class="replaceable"><code>name</code></em> SET SCHEMA <em class="replaceable"><code>new_schema</code></em>
  7. ALTER EXTENSION <em class="replaceable"><code>name</code></em> ADD <em class="replaceable"><code>member_object</code></em>
  8. ALTER EXTENSION <em class="replaceable"><code>name</code></em> DROP <em class="replaceable"><code>member_object</code></em>
  9. <span class="phrase">where <em class="replaceable"><code>member_object</code></em> is:</span>
  10. ACCESS METHOD <em class="replaceable"><code>object_name</code></em> |
  11. AGGREGATE <em class="replaceable"><code>aggregate_name</code></em> ( <em class="replaceable"><code>aggregate_signature</code></em> ) |
  12. CAST (<em class="replaceable"><code>source_type</code></em> AS <em class="replaceable"><code>target_type</code></em>) |
  13. COLLATION <em class="replaceable"><code>object_name</code></em> |
  14. CONVERSION <em class="replaceable"><code>object_name</code></em> |
  15. DOMAIN <em class="replaceable"><code>object_name</code></em> |
  16. EVENT TRIGGER <em class="replaceable"><code>object_name</code></em> |
  17. FOREIGN DATA WRAPPER <em class="replaceable"><code>object_name</code></em> |
  18. FOREIGN TABLE <em class="replaceable"><code>object_name</code></em> |
  19. FUNCTION <em class="replaceable"><code>function_name</code></em> [ ( [ [ <em class="replaceable"><code>argmode</code></em> ] [ <em class="replaceable"><code>argname</code></em> ] <em class="replaceable"><code>argtype</code></em> [, ...] ] ) ] |
  20. MATERIALIZED VIEW <em class="replaceable"><code>object_name</code></em> |
  21. OPERATOR <em class="replaceable"><code>operator_name</code></em> (<em class="replaceable"><code>left_type</code></em>, <em class="replaceable"><code>right_type</code></em>) |
  22. OPERATOR CLASS <em class="replaceable"><code>object_name</code></em> USING <em class="replaceable"><code>index_method</code></em> |
  23. OPERATOR FAMILY <em class="replaceable"><code>object_name</code></em> USING <em class="replaceable"><code>index_method</code></em> |
  24. [ PROCEDURAL ] LANGUAGE <em class="replaceable"><code>object_name</code></em> |
  25. PROCEDURE <em class="replaceable"><code>procedure_name</code></em> [ ( [ [ <em class="replaceable"><code>argmode</code></em> ] [ <em class="replaceable"><code>argname</code></em> ] <em class="replaceable"><code>argtype</code></em> [, ...] ] ) ] |
  26. ROUTINE <em class="replaceable"><code>routine_name</code></em> [ ( [ [ <em class="replaceable"><code>argmode</code></em> ] [ <em class="replaceable"><code>argname</code></em> ] <em class="replaceable"><code>argtype</code></em> [, ...] ] ) ] |
  27. SCHEMA <em class="replaceable"><code>object_name</code></em> |
  28. SEQUENCE <em class="replaceable"><code>object_name</code></em> |
  29. SERVER <em class="replaceable"><code>object_name</code></em> |
  30. TABLE <em class="replaceable"><code>object_name</code></em> |
  31. TEXT SEARCH CONFIGURATION <em class="replaceable"><code>object_name</code></em> |
  32. TEXT SEARCH DICTIONARY <em class="replaceable"><code>object_name</code></em> |
  33. TEXT SEARCH PARSER <em class="replaceable"><code>object_name</code></em> |
  34. TEXT SEARCH TEMPLATE <em class="replaceable"><code>object_name</code></em> |
  35. TRANSFORM FOR <em class="replaceable"><code>type_name</code></em> LANGUAGE <em class="replaceable"><code>lang_name</code></em> |
  36. TYPE <em class="replaceable"><code>object_name</code></em> |
  37. VIEW <em class="replaceable"><code>object_name</code></em>
  38. <span class="phrase">and <em class="replaceable"><code>aggregate_signature</code></em> is:</span>
  39. * |
  40. [ <em class="replaceable"><code>argmode</code></em> ] [ <em class="replaceable"><code>argname</code></em> ] <em class="replaceable"><code>argtype</code></em> [ , ... ] |
  41. [ [ <em class="replaceable"><code>argmode</code></em> ] [ <em class="replaceable"><code>argname</code></em> ] <em class="replaceable"><code>argtype</code></em> [ , ... ] ] ORDER BY [ <em class="replaceable"><code>argmode</code></em> ] [ <em class="replaceable"><code>argname</code></em> ] <em class="replaceable"><code>argtype</code></em> [ , ... ]
  42. </pre></div><div class="refsect1" id="id-1.9.3.11.5"><h2>Description</h2><p>
  43. <code class="command">ALTER EXTENSION</code> changes the definition of an installed
  44. extension. There are several subforms:
  45. </p><div class="variablelist"><dl class="variablelist"><dt><span class="term"><code class="literal">UPDATE</code></span></dt><dd><p>
  46. This form updates the extension to a newer version. The extension
  47. must supply a suitable update script (or series of scripts) that can
  48. modify the currently-installed version into the requested version.
  49. </p></dd><dt><span class="term"><code class="literal">SET SCHEMA</code></span></dt><dd><p>
  50. This form moves the extension's objects into another schema. The
  51. extension has to be <em class="firstterm">relocatable</em> for this command to
  52. succeed.
  53. </p></dd><dt><span class="term"><code class="literal">ADD <em class="replaceable"><code>member_object</code></em></code></span></dt><dd><p>
  54. This form adds an existing object to the extension. This is mainly
  55. useful in extension update scripts. The object will subsequently
  56. be treated as a member of the extension; notably, it can only be
  57. dropped by dropping the extension.
  58. </p></dd><dt><span class="term"><code class="literal">DROP <em class="replaceable"><code>member_object</code></em></code></span></dt><dd><p>
  59. This form removes a member object from the extension. This is mainly
  60. useful in extension update scripts. The object is not dropped, only
  61. disassociated from the extension.
  62. </p></dd></dl></div><p>
  63. See <a class="xref" href="extend-extensions.html" title="37.17. Packaging Related Objects into an Extension">Section 37.17</a> for more information about these
  64. operations.
  65. </p><p>
  66. You must own the extension to use <code class="command">ALTER EXTENSION</code>.
  67. The <code class="literal">ADD</code>/<code class="literal">DROP</code> forms require ownership of the
  68. added/dropped object as well.
  69. </p></div><div class="refsect1" id="id-1.9.3.11.6"><h2>Parameters</h2><p>
  70. </p><div class="variablelist"><dl class="variablelist"><dt><span class="term"><em class="replaceable"><code>name</code></em></span></dt><dd><p>
  71. The name of an installed extension.
  72. </p></dd><dt><span class="term"><em class="replaceable"><code>new_version</code></em></span></dt><dd><p>
  73. The desired new version of the extension. This can be written as
  74. either an identifier or a string literal. If not specified,
  75. <code class="command">ALTER EXTENSION UPDATE</code> attempts to update to whatever is
  76. shown as the default version in the extension's control file.
  77. </p></dd><dt><span class="term"><em class="replaceable"><code>new_schema</code></em></span></dt><dd><p>
  78. The new schema for the extension.
  79. </p></dd><dt><span class="term"><em class="replaceable"><code>object_name</code></em><br /></span><span class="term"><em class="replaceable"><code>aggregate_name</code></em><br /></span><span class="term"><em class="replaceable"><code>function_name</code></em><br /></span><span class="term"><em class="replaceable"><code>operator_name</code></em><br /></span><span class="term"><em class="replaceable"><code>procedure_name</code></em><br /></span><span class="term"><em class="replaceable"><code>routine_name</code></em></span></dt><dd><p>
  80. The name of an object to be added to or removed from the extension.
  81. Names of tables,
  82. aggregates, domains, foreign tables, functions, operators,
  83. operator classes, operator families, procedures, routines, sequences, text search objects,
  84. types, and views can be schema-qualified.
  85. </p></dd><dt><span class="term"><em class="replaceable"><code>source_type</code></em></span></dt><dd><p>
  86. The name of the source data type of the cast.
  87. </p></dd><dt><span class="term"><em class="replaceable"><code>target_type</code></em></span></dt><dd><p>
  88. The name of the target data type of the cast.
  89. </p></dd><dt><span class="term"><em class="replaceable"><code>argmode</code></em></span></dt><dd><p>
  90. The mode of a function, procedure, or aggregate
  91. argument: <code class="literal">IN</code>, <code class="literal">OUT</code>,
  92. <code class="literal">INOUT</code>, or <code class="literal">VARIADIC</code>.
  93. If omitted, the default is <code class="literal">IN</code>.
  94. Note that <code class="command">ALTER EXTENSION</code> does not actually pay
  95. any attention to <code class="literal">OUT</code> arguments, since only the input
  96. arguments are needed to determine the function's identity.
  97. So it is sufficient to list the <code class="literal">IN</code>, <code class="literal">INOUT</code>,
  98. and <code class="literal">VARIADIC</code> arguments.
  99. </p></dd><dt><span class="term"><em class="replaceable"><code>argname</code></em></span></dt><dd><p>
  100. The name of a function, procedure, or aggregate argument.
  101. Note that <code class="command">ALTER EXTENSION</code> does not actually pay
  102. any attention to argument names, since only the argument data
  103. types are needed to determine the function's identity.
  104. </p></dd><dt><span class="term"><em class="replaceable"><code>argtype</code></em></span></dt><dd><p>
  105. The data type of a function, procedure, or aggregate argument.
  106. </p></dd><dt><span class="term"><em class="replaceable"><code>left_type</code></em><br /></span><span class="term"><em class="replaceable"><code>right_type</code></em></span></dt><dd><p>
  107. The data type(s) of the operator's arguments (optionally
  108. schema-qualified). Write <code class="literal">NONE</code> for the missing argument
  109. of a prefix or postfix operator.
  110. </p></dd><dt><span class="term"><code class="literal">PROCEDURAL</code></span></dt><dd><p>
  111. This is a noise word.
  112. </p></dd><dt><span class="term"><em class="replaceable"><code>type_name</code></em></span></dt><dd><p>
  113. The name of the data type of the transform.
  114. </p></dd><dt><span class="term"><em class="replaceable"><code>lang_name</code></em></span></dt><dd><p>
  115. The name of the language of the transform.
  116. </p></dd></dl></div><p>
  117. </p></div><div class="refsect1" id="id-1.9.3.11.7"><h2>Examples</h2><p>
  118. To update the <code class="literal">hstore</code> extension to version 2.0:
  119. </p><pre class="programlisting">
  120. ALTER EXTENSION hstore UPDATE TO '2.0';
  121. </pre><p>
  122. </p><p>
  123. To change the schema of the <code class="literal">hstore</code> extension
  124. to <code class="literal">utils</code>:
  125. </p><pre class="programlisting">
  126. ALTER EXTENSION hstore SET SCHEMA utils;
  127. </pre><p>
  128. </p><p>
  129. To add an existing function to the <code class="literal">hstore</code> extension:
  130. </p><pre class="programlisting">
  131. ALTER EXTENSION hstore ADD FUNCTION populate_record(anyelement, hstore);
  132. </pre></div><div class="refsect1" id="id-1.9.3.11.8"><h2>Compatibility</h2><p>
  133. <code class="command">ALTER EXTENSION</code> is a <span class="productname">PostgreSQL</span>
  134. extension.
  135. </p></div><div class="refsect1" id="SQL-ALTEREXTENSION-SEE-ALSO"><h2>See Also</h2><span class="simplelist"><a class="xref" href="sql-createextension.html" title="CREATE EXTENSION"><span class="refentrytitle">CREATE EXTENSION</span></a>, <a class="xref" href="sql-dropextension.html" title="DROP EXTENSION"><span class="refentrytitle">DROP EXTENSION</span></a></span></div></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="sql-altereventtrigger.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="sql-commands.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="sql-alterforeigndatawrapper.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">ALTER EVENT TRIGGER </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> ALTER FOREIGN DATA WRAPPER</td></tr></table></div></body></html>
上海开阖软件有限公司 沪ICP备12045867号-1