PIB - PostgreSQL
オープンソースのリレーショナルデータベース。

ライセンス

BSD License. 広告条項なしの。

公式・準公式ページ

Tips

PHP と文字コード

PHP ソースの文字コードが DB と一致してないと困るので以下のようにしとくと吉
mb_detect_order("ASCII, JIS, UTF-8, EUC-JP, SJIS"); putenv("PGCLIENTENCODING=".mb_detect_encoding("◇◎ SJIS/EUC の判定"));

注意事項

タイムゾーン

環境変数 TZ が未設定だとなぜか
TZ=???+9
扱いになる事がある、、、(- -;;;)
# Cygwin の PostgreSQL 8.0.4 で確認、、、
postmaster 起動時に
TZ=JST-9
を設定しておく事。
select CURRENT_TIMESTAMP;
して、末尾が +09 なら正常に日本標準時が拾えている。
version 8.0 以前では text mode で large object を dump 出来なかったため -F c オプションで pg_restore 用の custom archive で出力すると共に -b, --blobs オプションにより明示的に large objects を dump する必要があった。
version 8.1 では text mode による large objects の dump に対応したため、デフォルトで large objects を dump するようになった。このため -b オプションは no-op 扱いになり、マニュアルから一旦姿を消している。
ところが version 8.2 では再びマニュアルに姿を現すと共に、--schema, --table, --schema-only オプションで選択的な dump をする際に large objects も出力する場合に限り意味を持つことが明記されるようになった。
参考:
  • PostgreSQL Manual
    • PostgreSQL 8.0.26 Documentation / pg_dump
    • PostgreSQL 8.1.23 Documentation / pg_dump
    • PostgreSQL 8.2.23 Documentation / pg_dump
    • PostgreSQL 8.1.23 Documentation / Appendix E. Release Notes / E.24. Release 8.1 # E.24.3.12. pg_dump Changes

関連