How do I verify the postgresql user and password are valid without the existence of a database?
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 PGPASSWORD=mypassword
.
After setting the password, what command can authenticate the user and password and return an error code or message?
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.
How do I login to PostgreSQL on the command line without specifying a database name?