Working with VMware vSphere 6.5 vCenter embedded vPostgres database – CLI commands

Working with VMware vSphere 6.5 vCenter embedded vPostgres database – CLI commands

VMware latest releases ship with the vPostgres database as their embedded database. If you are planning to migrate your current VMware environment you will get this as an option. If you are not sure with the next upgrade and the recommendation try vSphere Topology and upgrade planning tool. You can read my previous article from here.

So then you will have to work with this VMware embedded database and you need to use these commands. I believe this article will help you to interact with this embedded database. First of all you need to open a ssh session and connect to the shell

View the VCSA 6.5 embedded database configuration information


less /etc/vmware-vpx/embedded_db.cfg

command to view the configuration

You can see the details such as database type, database server, database port, database instance, database user, etc

To connect to the vCenter database :

/opt/vmware/vpostgres/current/bin/psql -d VCDB -U postgres

you can see the release version after that



to check the VCSA Product Version



to view the defined user roles in the database server, in the below output we have four users created. “postgres” is a super user.


To view all (describe all) the tables use :


To describe a specific table use:

\dt <table_name>

To turn on\off Expanded display use (see the described table command below as an expanded command) :


To view the list of available functions use:


To display the overall size of the vPostgres database in MB execute the below query:

SELECT pg_size_pretty(pg_database_size('VCDB'));

To display the Table size of the VPX_EVENT in KB use:

SELECT pg_size_pretty(pg_total_relation_size('VPX_EVENT'));

To list all the databases use:


I hope you might need to get a good understanding about these commands when you are working with vCenter vPostgres embedded database and my post will help you to get familiar with the vPostgres database.

A word of advice…

Click to rate this post!
[Total: 3 Average: 5]

Leave a Reply

Your email address will not be published. Required fields are marked *