title: Authenticate PostgreSQL user and password without database
body: <p>How do I verify the postgresql user and password are valid without the existence of a database?  </p>
  
  <p>I'm creating an automated installation that will create a database and run sql scripts to create tables.  The install needs to authenticate the user and password before running the scripts.  The automated install calls Windows batch files.  First I set the password, set <code>PGPASSWORD=mypassword</code>.</p>
  
  <p>After setting the password, what command can authenticate the user and password and return an error code or message?</p>
  
  <p>Other database programs (like IBM and db2) have an attach command which lets the user attach to the server or instance, without specifying a db name. I cannot find the equivalent for PostgreSQL.  </p>
  
  <p>How do I login to PostgreSQL on the command line without specifying a database name?</p>