LoginSignup
0
0

PostgreSQLサーバーの動作環境

Posted at

PostgreSQLインストール後確認すること

Postresqlをインストールした際に、データディレクトリと設定ファイルの場所については確認しておく事

設定ファイルの置き場所が違う場合がある

いろんな記事を読んでいると、postgresユーザーのホームディレクトリにデータディレクトリが置かれている場合が多く、最近の設定は複数バージョンの環境を作っても競合しないようにバージョン番号などで分けている場合が多い。

Debian Linux 11の場合

su -
でルートになる。
su - postgres
でpostgresユーザーになる。
pwd
でフォルダを確認すると
/var/lib/postgres
ls で内容を確認してみると 13 というフォルダがありその下に main がある構造

ディレクトリの確認方法

psql コマンドを起動

データディレクトリを確認
show data_directory;
/var/lib/postgresql/13/main と表示される

設定ファイルを確認
show config_file;
/etc/postgresql/13/main/postgresql.conf

これを確認することで、どんな環境でも設定ファイルを効率的に探すことが出来る。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0