Notice, by the way, this misleading result, at this stage: $ pg_config -version Ver Cluster Port Status Owner Data directory Log fileġ2 main 5432 online postgres /var/lib/postgresql/12/main /var/log/postgresql/postgresql-12-main.log It's telling me clearly that the client is on version 13 but the server is still on 12, as I confirmed: $ pg_lsclusters I read this as both the client and the server are at version 12.Īfter I upgraded Ubuntu from 20.04 to 21.04: $ sudo su postgres -c "psql" When I was on version 12: $ sudo su postgres -c "psql" I found that from version 12 onwards, simply invoking the client tells me what I need to know, but I ran them on the server's shell. This is quite an old question with many good answers. Note that the running psql can potentially be different from the one in the path. Client version:įor what it's worth, a shell command can be executed within psql to show the client version of the psql executable in the path. Using SQL: Server version: => SELECT version() $ postgres -V | awk '' -V # xargs is intentionally twice. Using CLI: Server version: $ postgres -V # Or -version.
0 Comments
Leave a Reply. |