ユーザ用ツール

サイト用ツール


serverapps:db:postgresql

差分

このページの2つのバージョン間の差分を表示します。

この比較画面にリンクする

両方とも前のリビジョン 前のリビジョン
次のリビジョン
前のリビジョン
serverapps:db:postgresql [2019/02/11 13:30]
hayashi [データベースの作成]
serverapps:db:postgresql [2023/07/28 19:52] (現在)
hayashi [/etc/rc.conf]
行 6: 行 6:
  
   postgresql_enable="YES"   postgresql_enable="YES"
-  postgresql_data="/usr/local/pgsql/data"+  postgresql_data="/usr/local/pgsql/DATA"
  
 ===== 初期化 ===== ===== 初期化 =====
行 16: 行 16:
      
   または   または
-  +  # service postgresql initdb 
 + 
 +  または
   # /usr/local/etc/rc.d/postgresql initdb   # /usr/local/etc/rc.d/postgresql initdb
  
行 35: 行 37:
   # service postgresql start   # service postgresql start
  
 +===== password変更 =====
 +rootユーザのパスワードを変更します。((パスワードは別紙参照))
 +  alter role postgres with password 'xxxxxxxxxxxxxxxxxxxx';
 +  
 ===== Role(ユーザ)の追加 ===== ===== Role(ユーザ)の追加 =====
  
行 97: 行 103:
 文字コードが標準と違う場合には 文字コードが標準と違う場合には
   TEMPLATE = template0   TEMPLATE = template0
-を指定+を指定する必要があります((必須です))
  
 +日本語DBの作成例
 +  CREATE DATABASE dbname WITH OWNER ownername 
 +    ENCODING UTF8 LC_COLLATE 'ja_JP.UTF-8' LC_CTYPE 'ja_JP.UTF-8'
 +    TEMPLATE template0
 +  ;
 +
 +なお、localeはエンコーディング部分はUTF8ではなくてUTF-8となります。マニュアルなどにはハイフンなしで書かれていますがハイフンが必要です。((FreeBSDで確認したので、Linuxでは違うかもしれません。マニュアルにも環境依存と書かれていますし…))
  
 ===== AutoVacuum ===== ===== AutoVacuum =====
行 108: 行 121:
  
  
 +http://everything-you-do-is-practice.blogspot.com/
serverapps/db/postgresql.1549859448.txt.gz · 最終更新: 2019/02/11 13:30 by hayashi