gooderp18绿色标准版
Nie możesz wybrać więcej, niż 25 tematów Tematy muszą się zaczynać od litery lub cyfry, mogą zawierać myślniki ('-') i mogą mieć do 35 znaków.

42 lines
5.5KB

  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>REASSIGN OWNED</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-prepare-transaction.html" title="PREPARE TRANSACTION" /><link rel="next" href="sql-refreshmaterializedview.html" title="REFRESH MATERIALIZED VIEW" /></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">REASSIGN OWNED</th></tr><tr><td width="10%" align="left"><a accesskey="p" href="sql-prepare-transaction.html" title="PREPARE TRANSACTION">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-refreshmaterializedview.html" title="REFRESH MATERIALIZED VIEW">Next</a></td></tr></table><hr></hr></div><div class="refentry" id="SQL-REASSIGN-OWNED"><div class="titlepage"></div><a id="id-1.9.3.160.1" class="indexterm"></a><div class="refnamediv"><h2><span class="refentrytitle">REASSIGN OWNED</span></h2><p>REASSIGN OWNED — change the ownership of database objects owned by a database role</p></div><div class="refsynopsisdiv"><h2>Synopsis</h2><pre class="synopsis">
  3. REASSIGN OWNED BY { <em class="replaceable"><code>old_role</code></em> | CURRENT_USER | SESSION_USER } [, ...]
  4. TO { <em class="replaceable"><code>new_role</code></em> | CURRENT_USER | SESSION_USER }
  5. </pre></div><div class="refsect1" id="id-1.9.3.160.5"><h2>Description</h2><p>
  6. <code class="command">REASSIGN OWNED</code> instructs the system to change
  7. the ownership of database objects owned by any of the
  8. <em class="replaceable"><code>old_roles</code></em> to
  9. <em class="replaceable"><code>new_role</code></em>.
  10. </p></div><div class="refsect1" id="id-1.9.3.160.6"><h2>Parameters</h2><div class="variablelist"><dl class="variablelist"><dt><span class="term"><em class="replaceable"><code>old_role</code></em></span></dt><dd><p>
  11. The name of a role. The ownership of all the objects within the
  12. current database, and of all shared objects (databases, tablespaces),
  13. owned by this role will be reassigned to
  14. <em class="replaceable"><code>new_role</code></em>.
  15. </p></dd><dt><span class="term"><em class="replaceable"><code>new_role</code></em></span></dt><dd><p>
  16. The name of the role that will be made the new owner of the
  17. affected objects.
  18. </p></dd></dl></div></div><div class="refsect1" id="id-1.9.3.160.7"><h2>Notes</h2><p>
  19. <code class="command">REASSIGN OWNED</code> is often used to prepare for the
  20. removal of one or more roles. Because <code class="command">REASSIGN
  21. OWNED</code> does not affect objects within other databases,
  22. it is usually necessary to execute this command in each database
  23. that contains objects owned by a role that is to be removed.
  24. </p><p>
  25. <code class="command">REASSIGN OWNED</code> requires membership on both the
  26. source role(s) and the target role.
  27. </p><p>
  28. The <a class="xref" href="sql-drop-owned.html" title="DROP OWNED"><span class="refentrytitle">DROP OWNED</span></a> command is an alternative that
  29. simply drops all the database objects owned by one or more roles.
  30. </p><p>
  31. The <code class="command">REASSIGN OWNED</code> command does not affect any
  32. privileges granted to
  33. the <em class="replaceable"><code>old_roles</code></em> on objects
  34. that are not owned by them. Likewise, it does not affect default
  35. privileges created with <code class="command">ALTER DEFAULT PRIVILEGES</code>.
  36. Use <code class="command">DROP OWNED</code> to revoke such privileges.
  37. </p><p>
  38. See <a class="xref" href="role-removal.html" title="21.4. Dropping Roles">Section 21.4</a> for more discussion.
  39. </p></div><div class="refsect1" id="id-1.9.3.160.8"><h2>Compatibility</h2><p>
  40. The <code class="command">REASSIGN OWNED</code> command is a
  41. <span class="productname">PostgreSQL</span> extension.
  42. </p></div><div class="refsect1" id="id-1.9.3.160.9"><h2>See Also</h2><span class="simplelist"><a class="xref" href="sql-drop-owned.html" title="DROP OWNED"><span class="refentrytitle">DROP OWNED</span></a>, <a class="xref" href="sql-droprole.html" title="DROP ROLE"><span class="refentrytitle">DROP ROLE</span></a>, <a class="xref" href="sql-alterdatabase.html" title="ALTER DATABASE"><span class="refentrytitle">ALTER DATABASE</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-prepare-transaction.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-refreshmaterializedview.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">PREPARE TRANSACTION </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> REFRESH MATERIALIZED VIEW</td></tr></table></div></body></html>
上海开阖软件有限公司 沪ICP备12045867号-1