トップ 一覧 検索 ヘルプ RSS ログイン

PostgreSQLの変更点

  • 追加された行はこのように表示されます。
  • 削除された行はこのように表示されます。
*TODO: PostgreSQL 全文検索
**Ludia
**senna
*TODO: 負荷分散
!!!サイト
!http://www.postgresql.org/
*http://www.postgresql.org/docs/manuals/

!EDB Postgres
*https://www.enterprisedb.com/
*https://www.enterprisedb.com/ja/
*https://www.ashisuto.co.jp/product/category/database/postgresql/

!!!関連
*postgresql rpmbuild
!!!メモ
!pgbench
*初期化
*測定
*消去
!psql
*DBの文字コードを確認する: \l
*処理時間を表示する: \timing
!pg_dumpall
*オプションなし --> \copy
*-d オプション
**INSERT INTO TABLE VALUES (....)
**PostgreSQL でないDBへの移行
**レストア遅い
*-D
**INSERT INTO TABLE (column1, col2, ...) VALUES ( .... )
**PostgreSQL でないDBへの移行
**レストアもっと遅い

!8.2 から 8.4 へのアップグレード

*ダンプ
 # pg_dumpall > pgsql-YYYYMMDD.dump
*PostgreSQL 停止
 # service postgresql stop
*PostgreSQL ファイル退避
 # mv /usr/local/pgsql /usr/local/pgsql-8.2
*8.2 アンインストール
 # pkg_info | grep postgresql
 # pkg_delete -f postgresql-client-8.2.22_3 postgresql-contrib-8.2.22_3 postgresql-server-8.2.22_3
*8.4 インストール
 # cd /usr/ports/database/postgresql84-server
 # make install
 # cd /usr/ports/database/postgresql84-contrib
 # make install
*PostgreSQL ファイル 初期化
 # service postgresql initdb
*PostgreSQL 開始
 # service postgresql start
*レストア
 # su -l pgsql
 $ cat pgsql-YYYYMMDD.dump | psql -f - postgres
**標準 database の postgres を指定する

!vacuum
*vacuum/analyze 実行日時の確認
 select schemaname,relname,last_vacuum,last_autovacuum,last_analyze,last_autoanalyze,vacuum_count,analyze_count from pg_stat_all_tables;
 select schemaname,relname,last_vacuum,last_autovacuum,last_analyze,last_autoanalyze,vacuum_count,analyze_count from pg_stat_all_tables order by schemaname,relname;
*psql コマンド
 vacuum verbose analyze
*コマンド
 time vacuum --verbose --analyze --all 2>&1


!!!分散 PostgreSQL
!!Slony-I
*http://slony.info/ 公式サイト
*非同期レプリケーション
*シングルマスタ
!!参考記事
!コアメンバが開発したレプリケーション・ソフトSlony-I / 【PostgreSQLウォッチ】第12回 / ITPro 
*http://itpro.nikkeibp.co.jp/members/ITPro/oss/20041027/151827/ 高橋信頼 2004-11
!!Bucardo
*http://bucardo.org/ 公式サイト
*非同期レプリケーション
*マルチマスタ
*perl でレプリケーションを実施

!ストリーミング・レプリケーションの構築
*http://lets.postgresql.jp/documents/technical/replication/1
!!!記事
!今すぐできるPostgreSQLチューニング
*http://www.thinkit.co.jp/free/tech/10/1/1.html
*日本PostgreSQLユーザ会  片岡 裕生   2005/7/20
*共有バッファ
*トランザクションログバッファ  
*ライタープロセスのチューニング
*テーブルスペース
*チェックポイントセグメント数
*ファイルシステム
!PostgreSQLチューニング実践テクニック
*http://www.thinkit.co.jp/free/marugoto/2/1/11/1.html
*石井達夫(ISHII, Tatsuo)   2005/5/25

!postgresのスキーマ切り替え / @bibio Qiita
*https://qiita.com/bibio/items/dc37e9dabb7b78bcf71f
*CLIからスキーマ一覧の表示
 \dn
*現在のスキーマ
 select current_schema();
*スキーマを変更する
 SET search_path = my_schema;