ツムラ_メモ

大失敗を繰り返す。

MacOSXへMac Portsを使ってPostgresql 8.4をインストール

sh-3.2# port install postgresql84-server

      • > Fetching postgresql84-server
      • > Verifying checksum(s) for postgresql84-server
      • > Extracting postgresql84-server
      • > Configuring postgresql84-server
      • > Building postgresql84-server
      • > Staging postgresql84-server into destroot
      • > Creating launchd control script

###########################################################
# A startup item has been generated that will aid in
# starting postgresql84-server with launchd. It is disabled
# by default. Execute the following command to start it,
# and to cause it to launch at startup:
#
# sudo launchctl load -w /Library/LaunchDaemons/org.macports.postgresql84-server.plist
###########################################################

      • > Installing postgresql84-server @8.4.0_0

To create a database instance, after install do
sudo mkdir -p /opt/local/var/db/postgresql84/defaultdb
sudo chown postgres:postgres /opt/local/var/db/postgresql84/defaultdb
sudo su postgres -c '/opt/local/lib/postgresql84/bin/initdb -D /opt/local/var/db/postgresql84/defaultdb'

To tweak your DBMS, consider increasing kern.sysv.shmmax by adding an increased kern.sysv.shmmax .. to /etc/sysctl.conf

      • > Activating postgresql84-server @8.4.0_0
      • > Cleaning postgresql84-server

$ sudo mkdir -p /opt/local/var/db/postgresql84/defaultdb
$ sudo chown postgres:postgres /opt/local/var/db/postgresql84/defaultdb
$ sudo su postgres -c '/opt/local/lib/postgresql84/bin/initdb -D /opt/local/var/db/postgresql84/defaultdb'

The files belonging to this database system will be owned by user "postgres".
This user must also own the server process.

The database cluster will be initialized with locale ja_JP.UTF-8.
The default database encoding has accordingly been set to UTF8.
initdb: could not find suitable text search configuration for locale ja_JP.UTF-8
The default text search configuration will be set to "simple".

fixing permissions on existing directory /opt/local/var/db/postgresql84/defaultdb ... ok
creating subdirectories ... ok
selecting default max_connections ... 30
selecting default shared_buffers ... 2400kB
creating configuration files ... ok
creating template1 database in /opt/local/var/db/postgresql84/defaultdb/base/1 ... ok
initializing pg_authid ... ok
initializing dependencies ... ok
creating system views ... ok
loading system objects' descriptions ... ok
creating conversions ... ok
creating dictionaries ... ok
setting privileges on built-in objects ... ok
creating information schema ... ok
vacuuming database template1 ... ok
copying template1 to template0 ... ok
copying template1 to postgres ... ok

WARNING: enabling "trust" authentication for local connections
You can change this by editing pg_hba.conf or using the -A option the
next time you run initdb.

Success. You can now start the database server using:

/opt/local/lib/postgresql84/bin/postgres -D /opt/local/var/db/postgresql84/defaultdb
or
/opt/local/lib/postgresql84/bin/pg_ctl -D /opt/local/var/db/postgresql84/defaultdb -l logfile start