入口
pkgsrc による設置
  php3
    php3-i18n
    database/php3-pgsql
    www/ap-php3
apache 版
postgres (1)
  php4-pgsql (3)
    make install
php4 (apache1)
  www/php4(2)
    php4 の版
  www/ap-php4(5)
  www/apache(4)
    IPv6
    IPv4+nossl
    Apache/SSL
php4(apache2) - 依存関係
  ap2-php4
    php4
    mod_php4.so
    /usr/pkg/etc/php.ini
  php4-session(6)
    session.so
    --enable-session
    core_globals
    map
    php4 i18n 無
    php4 i18n
  configure
セッション管理
  php3 互換モード
  php4 内蔵
  php4 + phplib
  phpinfo()
PostgreSQL 準備
  postmaster
  環境変数
  initdb
    実際の様子
    試しに起動
  postmaster 設定
  postgreql.conf
  pg_hba.conf
  postmaster の起動
  使用者登録
  pg_ctl
  /etc/rc.conf
  shutdown
データべースを作る
psql
  psql \h
  psql \?
  psql \h select
  psql \d
  psql \copy
  psql 操作
  Data Type
    DATE
Application
  pgpost
    pgpost 設置例
    psql で見る
  AuthPG
      create table
        GRANT
  pgimage
  pgimage psql
SQL
URL
  PostgreSQL
  PHP
良くある問題
    undefined pg_connect()
    Link-ID == false
    Call-time pass-by-reference
    session_register
    Undefined session_adapt_flush
    Failed opening for inclusion
  does not exist in ..
  pg_exec() query failed
  Undefined property: Port
  undefined function: preg_match()
  used in non-rule query
その他
適用例
  日記から等

PostgreSQL + Apache + PHP4 | PHP4 programming

pgpost 設置例

ttyp0:makoto@u  13:13:59/040408(...local-src/pgpost-1.3.2)> cd data
ttyp0:makoto@u  13:14:00/040408(...pgpost-1.3.2/data)> gmake create.sql
sed -e "s@_REPLACE_ME_@`pwd`@" create.source > create.sql
ttyp0:makoto@u  13:14:09/040408(...pgpost-1.3.2/data)> createdb postal
CREATE DATABASE
ttyp0:makoto@u  13:14:24/040408(...pgpost-1.3.2/data)> psql -e postal < create.sql 
drop table postal;
ERROR:  table "postal" does not exist
create table postal (
        oldcode varchar(5),
        newcode char(7),
        pid int2,
        kana_city text,
        kana_town text,
        city text,
        town text
);
CREATE TABLE
drop table prefecture;
ERROR:  table "prefecture" does not exist
create table prefecture (
        pid int2,
        pref char(8),
        kana_pref char(16)
);
CREATE TABLE
copy postal from '/export/local-src/pgpost-1.3.2/data/postal.data';
CREATE TABLE
drop table prefecture;
ERROR:  table "prefecture" does not exist
DROP TABLE
create table prefecture (
        pid int2,
        pref char(8),
        kana_pref char(16)
);
CREATE TABLE
copy postal from '/export/local-src/pgpost-1.3.2/data/postal.data';
COPY
copy prefecture from '/export/local-src/pgpost-1.3.2/data/prefecture.data';
COPY
create index oldcodeindex on postal using btree(oldcode);
CREATE INDEX
create index newcodeindex on postal using btree(newcode);
CREATE INDEX
create index pidindex on postal using btree(pid);
CREATE INDEX
create index cityindex on postal using btree(city);
CREATE INDEX
create index townindex on postal using btree(town);
CREATE INDEX
create index kana_cityindex on postal using btree(kana_city);
CREATE INDEX
create index kana_townindex on postal using btree(kana_town);
CREATE INDEX
create index prefpidindex on prefecture using btree(pid);
この画面は Jeedosaquin によって表示しています。
Last Update: Sat, 04 May 2019 00:45:20 GMT 1.66 2008/03/08