Home Explore Blog CI



postgresql

2nd chunk of `doc/src/sgml/ref/dropdb.sgml`
a729d9c99351f0935acf9b7c7ea5b4d3f6dfa13b2e6472120000000100000c32
 <term><option>--if-exists</option></term>
      <listitem>
       <para>
       Do not throw an error if the database does not exist. A notice is issued
       in this case.
       </para>
      </listitem>
     </varlistentry>

     <varlistentry>
       <term><option>-?</option></term>
       <term><option>--help</option></term>
       <listitem>
       <para>
       Show help about <application>dropdb</application> command line
       arguments, and exit.
       </para>
       </listitem>
     </varlistentry>

    </variablelist>

  </para>

  <para>
   <application>dropdb</application> also accepts the following
   command-line arguments for connection parameters:

   <variablelist>
     <varlistentry>
      <term><option>-h <replaceable class="parameter">host</replaceable></option></term>
      <term><option>--host=<replaceable class="parameter">host</replaceable></option></term>
      <listitem>
       <para>
        Specifies the host name of the machine on which the
        server
        is running.  If the value begins with a slash, it is used
        as the directory for the Unix domain socket.
       </para>
      </listitem>
     </varlistentry>

     <varlistentry>
      <term><option>-p <replaceable class="parameter">port</replaceable></option></term>
      <term><option>--port=<replaceable class="parameter">port</replaceable></option></term>
      <listitem>
       <para>
        Specifies the TCP port or local Unix domain socket file
        extension on which the server
        is listening for connections.
       </para>
      </listitem>
     </varlistentry>

     <varlistentry>
      <term><option>-U <replaceable class="parameter">username</replaceable></option></term>
      <term><option>--username=<replaceable class="parameter">username</replaceable></option></term>
      <listitem>
       <para>
        User name to connect as.
       </para>
      </listitem>
     </varlistentry>

     <varlistentry>
      <term><option>-w</option></term>
      <term><option>--no-password</option></term>
      <listitem>
       <para>
        Never issue a password prompt.  If the server requires
        password authentication and a password is not available by
        other means such as a <filename>.pgpass</filename> file, the
        connection attempt will fail.  This option can be useful in
        batch jobs and scripts where no user is present to enter a
        password.
       </para>
      </listitem>
     </varlistentry>

     <varlistentry>
      <term><option>-W</option></term>
      <term><option>--password</option></term>
      <listitem>
       <para>
        Force <application>dropdb</application> to prompt for a
        password before connecting to a database.
       </para>

       <para>
        This option is never essential, since
        <application>dropdb</application> will automatically prompt
        for a password if the server demands password authentication.
        However, <application>dropdb</application> will waste a
        connection attempt finding out that the server wants a password.
        In some cases it is worth

Title: dropdb: Command-Line Options and Connection Parameters
Summary
The `dropdb` command accepts several command-line arguments including: `--if-exists` to avoid errors if the database doesn't exist, and `--help` to display help information. It also accepts connection parameters such as: `-h` or `--host` to specify the server's hostname, `-p` or `--port` to specify the TCP port, `-U` or `--username` to specify the username, `-w` or `--no-password` to avoid password prompts, and `-W` or `--password` to force a password prompt.