gooderp18绿色标准版
Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

28 lines
3.6KB

  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>22.5. Destroying a Database</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="manage-ag-config.html" title="22.4. Database Configuration" /><link rel="next" href="manage-ag-tablespaces.html" title="22.6. Tablespaces" /></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">22.5. Destroying a Database</th></tr><tr><td width="10%" align="left"><a accesskey="p" href="manage-ag-config.html" title="22.4. Database Configuration">Prev</a> </td><td width="10%" align="left"><a accesskey="u" href="managing-databases.html" title="Chapter 22. Managing Databases">Up</a></td><th width="60%" align="center">Chapter 22. Managing Databases</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="manage-ag-tablespaces.html" title="22.6. Tablespaces">Next</a></td></tr></table><hr></hr></div><div class="sect1" id="MANAGE-AG-DROPDB"><div class="titlepage"><div><div><h2 class="title" style="clear: both">22.5. Destroying a Database</h2></div></div></div><p>
  3. Databases are destroyed with the command
  4. <a class="xref" href="sql-dropdatabase.html" title="DROP DATABASE"><span class="refentrytitle">DROP DATABASE</span></a>:<a id="id-1.6.9.8.2.2" class="indexterm"></a>
  5. </p><pre class="synopsis">
  6. DROP DATABASE <em class="replaceable"><code>name</code></em>;
  7. </pre><p>
  8. Only the owner of the database, or
  9. a superuser, can drop a database. Dropping a database removes all objects
  10. that were
  11. contained within the database. The destruction of a database cannot
  12. be undone.
  13. </p><p>
  14. You cannot execute the <code class="command">DROP DATABASE</code> command
  15. while connected to the victim database. You can, however, be
  16. connected to any other database, including the <code class="literal">template1</code>
  17. database.
  18. <code class="literal">template1</code> would be the only option for dropping the last user database of a
  19. given cluster.
  20. </p><p>
  21. For convenience, there is also a shell program to drop
  22. databases, <a class="xref" href="app-dropdb.html" title="dropdb"><span class="refentrytitle"><span class="application">dropdb</span></span></a>:<a id="id-1.6.9.8.4.2" class="indexterm"></a>
  23. </p><pre class="synopsis">
  24. dropdb <em class="replaceable"><code>dbname</code></em>
  25. </pre><p>
  26. (Unlike <code class="command">createdb</code>, it is not the default action to drop
  27. the database with the current user name.)
  28. </p></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="manage-ag-config.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="managing-databases.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="manage-ag-tablespaces.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">22.4. Database Configuration </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> 22.6. Tablespaces</td></tr></table></div></body></html>
上海开阖软件有限公司 沪ICP备12045867号-1