Unable to open the bsmbrowser tool to run DB queries on embedded Postgres

  • KM03751716
  • 22-Oct-2020
  • 12-May-2021

Summary

When working on an OBM on a Linux environment you may not be able to launch a graphic UI to use the OBM/OMi bsmbrowser tool, or do not have access to the Postgres PgAdmin4 management interface

Question

How to access the Postgress embedded DB via command line on Linux

Answer

On OBM/OMi on Linux when using the embedded Postgres database there are several Postgres components installed, this will be located at the following path /opt/HP/BSM/pgsql/bin/ on here we can use the pgsql tool to connect to the embedded Database, example: /opt/HP/BSM/pgsql/bin/pgsql -p 5433 --username=postgres -d <DB name>; where:

-d =  name of the database to connect, by default will connect to “postgres”.

--username = user to be used, postgres is the default username.

-p = the port used to connect to the Postgres DB, 5433 is the default for the embedded DB.

 

When prompted for the password enter the Postgres administrator password that was configured when setting up OBM, if that is not correct try the default password “postgres”

 

Once connected can use the “\c <db name>” to connect to another database if needed and run the regular SQL syntax queries like select, alter, update, count, and so on.

 

To exit the Postgres and go back to the OS terminal type “\q”