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

数据库系统

开发平台:

Unix_Linux

  1. <refentry id="APP-DESTROYUSER">
  2.  <refmeta>
  3.   <refentrytitle>
  4.    <application>destroyuser</application>
  5.   </refentrytitle>
  6.   <refmiscinfo>Application</refmiscinfo>
  7.  </refmeta>
  8.  <refnamediv>
  9.   <refname>
  10.    <application>destroyuser</application>
  11.   </refname>
  12.   <refpurpose>
  13.    Destroy a <productname>Postgres</productname> user and associated databases
  14.   </refpurpose>
  15.  </refnamediv>
  16.  <refsynopsisdiv>
  17.   <refsynopsisdivinfo>
  18.    <date>1998-10-02</date>
  19.   </refsynopsisdivinfo>
  20.   <synopsis>
  21. destroyuser [ <replaceable class="parameter">username</replaceable> ]
  22. destroyuser [ -h <replaceable class="parameter">host</replaceable> ] [ -p <replaceable class="parameter">port</replaceable> ]
  23.     [ <replaceable class="parameter">username</replaceable> ]
  24.   </synopsis>
  25.   <refsect2 id="R2-APP-DESTROYUSER-1">
  26.    <refsect2info>
  27.     <date>1998-10-02</date>
  28.    </refsect2info>
  29.    <title>
  30.     Inputs
  31.    </title>
  32.    <para>
  33.     <variablelist>
  34.      <varlistentry>
  35.       <term>-h <replaceable class="parameter">host</replaceable></term>
  36.       <listitem>
  37.        <para>
  38. Specifies the hostname of the machine on which the 
  39. <application>postmaster</application>
  40. is running.  Defaults to using a local Unix domain socket
  41. rather than an IP connection.
  42.        </para>
  43.       </listitem>
  44.      </varlistentry>
  45.      <varlistentry>
  46.       <term>-p <replaceable class="parameter">port</replaceable></term>
  47.       <listitem>
  48.        <para>
  49. Specifies the Internet TCP/IP port or local Unix domain socket file 
  50. extension on which the <application>postmaster</application>
  51. is listening for connections.  The port number defaults to 5432,
  52. or the value of the <envar>PGPORT</envar>
  53. environment variable (if set).
  54.        </para>
  55.       </listitem>
  56.      </varlistentry>
  57.      <varlistentry>
  58.       <term><replaceable class="parameter">username</replaceable></term>
  59.       <listitem>
  60.        <para>
  61. Specifies the name of the <productname>Postgres</productname> user to be removed. 
  62. This name must exist in the <productname>Postgres</productname> installation.
  63. You will be prompted for a name if none is specified on the command line.
  64.        </para>
  65.       </listitem>
  66.      </varlistentry>
  67.     </variablelist>
  68.    </para>
  69.   </refsect2>
  70.   <refsect2 id="R2-APP-DESTROYUSER-2">
  71.    <refsect2info>
  72.     <date>1998-10-02</date>
  73.    </refsect2info>
  74.    <title>
  75.     Outputs
  76.    </title>
  77.    <para>
  78.     <application>destroyuser</application> will remove an entry in the
  79.     <literal>pg_user</literal> or <literal>pg_shadow</literal> system table,
  80.     and will remove all databases for which that user is the administrator
  81.     (<acronym>DBA</acronym>).
  82.     <variablelist>
  83.      <varlistentry>
  84.       <term><computeroutput>
  85. Connection to database 'template1' failed.
  86. connectDB() failed: Is the postmaster running and accepting connections
  87.             at 'UNIX Socket' on port '<replaceable class="parameter">port</replaceable>'?
  88. destroyuser: database access failed.
  89.        </computeroutput></term>
  90.       <listitem>
  91.        <para>
  92. <application>destroyuser</application> could not attach to the 
  93. <application>postmaster</application> 
  94. process on the specified host and port.  If you see this message,
  95. ensure that the <application>postmaster</application> 
  96. is running on the proper host and that you have specified the proper
  97. port.  If your site uses an authentication system, ensure that you
  98. have obtained the required authentication credentials.
  99.        </para>
  100.       </listitem>
  101.      </varlistentry>
  102.      <varlistentry>
  103.       <term><computeroutput>
  104. Connection to database 'template1' failed.
  105. FATAL 1:  SetUserId: user '<replaceable class="parameter">username</replaceable>' is not in 'pg_shadow'
  106. destroyuser: database access failed.
  107.       </computeroutput></term>
  108.       <listitem>
  109.        <para>
  110. You do not have a valid entry in the relation <literal>pg_shadow</literal>
  111. and and will not be allowed to access <productname>Postgres</productname>. Contact your
  112. <productname>Postgres</productname> administrator.
  113.        </para>
  114.       </listitem>
  115.      </varlistentry>
  116.      <varlistentry>
  117.       <term><computeroutput>
  118. destroyuser: <replaceable class="parameter">username</replaceable> cannot delete users.
  119.       </computeroutput></term>
  120.       <listitem>
  121.        <para>
  122. You do not have permission to delete users; contact your
  123. <productname>Postgres</productname> site administrator.
  124.        </para>
  125.       </listitem>
  126.      </varlistentry>
  127.      <varlistentry>
  128.       <term><computeroutput>
  129. destroyuser: user "<replaceable class="parameter">username</replaceable>" already exists
  130.       </computeroutput></term>
  131.       <listitem>
  132.        <para>
  133. The user to be added already has an entry in the
  134. <literal>pg_shadow</literal> class.
  135.        </para>
  136.       </listitem>
  137.      </varlistentry>
  138.      <varlistentry>
  139.       <term><computeroutput>
  140. database access failed
  141.       </computeroutput></term>
  142.       <listitem>
  143.        <para>
  144. An internal error occurred in <application>psql</application>
  145. or in the backend server.  Ensure that your site administrator has
  146. properly installed <productname>Postgres</productname>and initialized the site with 
  147. <application>initdb</application>.
  148.        </para>
  149.       </listitem>
  150.      </varlistentry>
  151.      <varlistentry>
  152.       <term><computeroutput>
  153. destroydb on <replaceable class="parameter">dbname</replaceable> failed - exiting
  154.       </computeroutput></term>
  155.       <listitem>
  156.        <para>
  157. An internal error occurred in <application>psql</application>
  158. or in the backend server. There was possibly a Unix permissions problem with the
  159. specified database.
  160.        </para>
  161.       </listitem>
  162.      </varlistentry>
  163.      <varlistentry>
  164.       <term><computeroutput>
  165. delete of user <replaceable class="parameter">username</replaceable> was UNSUCCESSFUL
  166.        </computeroutput></term>
  167.       <listitem>
  168.        <para>
  169. An internal error occurred in <application>psql</application>
  170. or in the backend server.
  171.        </para>
  172.       </listitem>
  173.      </varlistentry>
  174.     </variablelist>
  175.    </para>
  176.    <note>
  177.     <para>
  178.      <application>destroyuser</application> internally runs
  179.      <command>DROP USER</command> from <application>psql</application>
  180.      while connected to the <literal>template1</literal> database.
  181.     </para>
  182.    </note>
  183.   </refsect2>
  184.  </refsynopsisdiv>
  185.  <refsect1 id="R1-APP-DESTROYUSER-1">
  186.   <refsect1info>
  187.    <date>1998-10-02</date>
  188.   </refsect1info>
  189.   <title>
  190.    Description
  191.   </title>
  192.   <para>
  193.    <application>destroyuser</application> removes an existing
  194.    <productname>Postgres</productname> user
  195.    and the databases for which that user
  196.    is database administrator.
  197.    Only users with <literal>usesuper</literal> set in
  198.    the <literal>pg_shadow</literal> class can destroy 
  199.    <productname>Postgres</productname> users.  As shipped,
  200.    the user <literal>postgres</literal> can remove users.
  201.   </para>
  202.   <para>
  203.    <application>destroyuser</application> is a shell script that invokes
  204.    <application>psql</application>.
  205.    Hence, a <application>postmaster</application>
  206.    process must be running on the database server host before
  207.    <application>destroyuser</application> is executed.
  208.    The 
  209.    <envar>PGOPTION</envar>
  210.    and
  211.    <envar>PGREALM</envar>
  212.    environment variables will be passed on to
  213.    <application>psql</application>
  214.    and processed as described in <xref endterm="psql-ref"
  215.     linkend="app-psql">.
  216.   </para>
  217.   <para>
  218.    Once invoked, <application>destroyuser</application>
  219.    will warn you about the databases that will be destroyed in the
  220.    process and permit you to abort the removal of the user if desired.
  221.   </para>
  222.  </refsect1>
  223. </refentry>
  224. <!-- Keep this comment at the end of the file
  225. Local variables:
  226. mode: sgml
  227. sgml-omittag:nil
  228. sgml-shorttag:t
  229. sgml-minimize-attributes:nil
  230. sgml-always-quote-attributes:t
  231. sgml-indent-step:1
  232. sgml-indent-data:t
  233. sgml-parent-document:nil
  234. sgml-default-dtd-file:"../reference.ced"
  235. sgml-exposed-tags:nil
  236. sgml-local-catalogs:"/usr/lib/sgml/catalog"
  237. sgml-local-ecat-files:nil
  238. End:
  239. -->