Thanks for watching.
Any thoughts? Write a comment.
If you liked the video, Like and Subscribe.
It helps to create more videos!
psql --version
Connect to the database
psql -U postgres -d your_database
Run the version command
SELECT version();
For Ubuntu/Debian:
dpkg -l | grep postgresql
apt list --installed | grep postgresql
For CentOS/RHEL:
rpm -qa | grep postgresql
cat /path/to/your/data/directory/PG_VERSION
pg_ctl -V
To find out the version of PostgreSQL installed on your system, you can use several methods
Using PostgreSQL Interactive Terminal
Connecting to PostgreSQL Server and Running SQL Query
Using System Package Managers
Checking the PostgreSQL Data Directory
Using pg_ctl Utility