title: How do I force any user accessing my PostgreSQL database to provide a password?
body: <p>In my Rails app, database.yml:</p>
  
  <pre><code>development:
    &lt;&lt;: *default
    database: minecraft-kingdoms_development
    username: jacobcrofts
    password: &lt;%= ENV['MINECRAFT-KINGDOMS_DATABASE_PASSWORD'] %&gt;
  </code></pre>
  
  <p>The password is supplied by an environment variable, which I load automatically.</p>
  
  <p>upon \du in the Postgres console:</p>
  
  <pre><code> Role name |                   Attributes                   |
  -----------+------------------------------------------------+
  jacobcrofts| Superuser, Create role, Create DB, Replication |
  </code></pre>
  
  <p>I am worried because my Java plugin is able to access the database without providing a password. All it needs is the correct host and username, and any password (or none at all) will allow my plugin to establish a connection to the database.</p>
  
  <p>I want to force my Java plugin to provide a password upon accessing my database for obvious security reasons. How can I do this? Why isn't providing a password field in database.yml sufficient?</p>