#author("2020-08-21T02:35:51+09:00","default:ryuichi","ryuichi")
#author("2020-08-21T02:48:08+09:00","default:ryuichi","ryuichi")
* バージョンの確認 [#z59ac209]
** SQL [#ic6db261]
postgres=> SELECT version();
version
-----------------------------------------------------------------------------------------------------------
PostgreSQL 9.6.19 on x86_64-pc-linux-gnu, compiled by gcc (Debian 6.3.0-18+deb9u1) 6.3.0 20170516, 64-bit
(1 行)
** インストール済みパッケージ [#x3052021]
*** Debian系 [#f6c750fc]
$ apt list --installed | grep postgres
postgresql-9.6/oldstable,now 9.6.19-0+deb9u1 amd64 [インストール済み]
*** RPM系 [#oa3f28bd]
$ yum list installed | grep postgres
postgresql-server.x86_64 9.2.24-4.el7_8 @updates
** 実行中プロセス [#j79af624]
*** Debian系 [#bb032d91]
$ ps ax | grep postgres
32744 ? S 0:09 /usr/lib/postgresql/9.6/bin/postgres -D /var/lib/postgresql/9.6/main
$ dpkg -S /usr/lib/postgresql/9.6/bin/postgres
postgresql-9.6: /usr/lib/postgresql/9.6/bin/postgres
$ dpkg -s postgresql-9.6 | grep Version
Version: 9.6.19-0+deb9u1
*** RPM系 [#fac752a0]
$ ps auxww | grep postgres
postgres 11458 0.0 0.9 232800 9420 ? S 02:42 0:00 /usr/bin/postgres -D /var/lib/pgsql/data -p 5432
$ yum provides /usr/bin/postgres
postgresql-server-9.2.24-4.el7_8.x86_64 : The programs needed to create and run a PostgreSQL server
リポジトリー : updates
$ rpm -qi postgresql-server-9.2.24-4.el7_8.x86_64 | grep Version
Version : 9.2.24
** デーモン起動設定 [#c996ddd7]
*** Systemd [#l2a39782]
$ systemctl list-unit-files | grep postgres
$ systemctl status postgresql.service
$ cat /lib/systemd/system/postgresql.service
*** Init [#e68a10fc]
$ cat /etc/init.d/postgreql
** psqlコマンドのバージョン [#bb5d70b0]
$ psql -V
psql (PostgreSQL) 12.4 (Debian 12.4-1.pgdg90+1)
- psqlコマンドのバージョンであって、PostgreSQLサーバのバージョンではない