postgresqlHow do I get the version of PostgreSQL installed on my system?
The version of PostgreSQL installed on your system can be obtained by using the psql
command.
psql --version
Output example
psql (PostgreSQL) 10.12
The psql
command is used to connect to a PostgreSQL database, and it also provides several options to obtain information about the PostgreSQL installation. The --version
option prints the version of the PostgreSQL server.
The version of PostgreSQL can also be obtained by using the SELECT version()
statement.
SELECT version();
Output example
PostgreSQL 10.12 on x86_64-pc-linux-gnu, compiled by gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-39), 64-bit
The SELECT version()
statement returns the version of the PostgreSQL server, the operating system, and the compiler used to build the server.
To summarize, the version of PostgreSQL installed on your system can be obtained by using the psql --version
command or the SELECT version()
statement.
Helpful links
More of Postgresql
- How do I use PostgreSQL ZonedDateTime to store date and time information?
- How can Zalando use PostgreSQL to improve its software development?
- How can I troubleshoot zero damaged pages in PostgreSQL?
- How can I use PostgreSQL and ZFS snapshots together?
- How can I integrate PostgreSQL with Yii2?
- How can I retrieve data from PostgreSQL for yesterday's date?
- How can I use PostgreSQL XML functions to manipulate XML data?
- How do I use PostgreSQL's XMLTABLE to parse XML data?
- How can I set a PostgreSQL interval to zero?
- How can I use PostgreSQL's "zero if null" feature?
See more codes...