[pgsql-jp: 29844] Windows2000 + Cygwin + PostgreSQL の組み合わせ
M Tera
m_teracchi @ yahoo.co.jp
2003年 5月 11日 (日) 02:45:32 JST
寺口と申します.
はじめて PostgreSQL のメーリングリストに投稿させていただきます.
現在,
「Windowsユーザのための PostgreSQL 導入活用ガイド」
および
Something PostgreSQL (http://www.nonsensecorner.com/pgsql/)
に基づきまして,下記環境で PostgreSQL を動作させようと試みております.
<環境>
Windows 2000
Cygwin 1.3.12
PostgreSQL 7.2.2
導入活用ガイドに付属の CD-ROM を用いて,次の手順でインストールを行いました.
(1) cygwin 1.3.12 をインストール
(2) cygipc-1.10.1-patched-bin.tar.bz2 を解凍してインストール
$ bzip2 -d -c cygipc-1.10.1-patched-bin.tar.bz2 | tar xvf - -C /usr/local
(3) postgresql7.2.2-cygwin-mb.tar.bz2 を解凍してインストール
$ bzip2 -d -c postgresql7.2.2-cygwin-mb.tar.bz2 | tar xvf - -C /usr/local
(4) 2つの環境変数を設定
PGDATA, PGLIB
この時点で
$ uname -a
CYGWIN_NT-5.0 TERA-THINKPAD 1.3.12(0.54/3/2) 2002-07-06 02:16 i686 unknown
$ psql -V
psql (PostgreSQL) 7.2.2
contains support for: readline, history, multibyte
$ env | grep PG
PGDATA=/mnt/e/Home/web/data
PGLIB=/usr/local/pgsql/lib
となっております.
続いて,ipc-daemon の起動,initdb, postmaster の起動を行いました.
$ ipc-daemon &
[1] 1796
$ initdb -E EUC_JP
The files belonging to this database system will be owned by user "root".
This user must also own the server process.
Fixing permissions on existing directory /mnt/e/Home/web/data... ok
creating directory /mnt/e/Home/web/data/base... ok
creating directory /mnt/e/Home/web/data/global... ok
creating directory /mnt/e/Home/web/data/pg_xlog... ok
creating directory /mnt/e/Home/web/data/pg_clog... ok
creating template1 database in /mnt/e/Home/web/data/base/1... ok
creating configuration files... ok
initializing pg_shadow... ok
enabling unlimited row size for system tables... ok
creating system views... ok
loading pg_description... ok
vacuuming database template1... ok
copying template1 to template0... ok
Success. You can now start the database server using:
/usr/local/pgsql/bin/postmaster -D /mnt/e/Home/web/data
or
/usr/local/pgsql/bin/pg_ctl -D /mnt/e/Home/web/data -l logfile start
$ postmaster -i &
[2] 1832
DEBUG: database system was shut down at 2003-05-11 02:27:15 JST
DEBUG: checkpoint record is at 0/113640
DEBUG: redo record is at 0/113640; undo record is at 0/0; shutdown TRUE
DEBUG: next transaction id: 89; next oid: 16556
DEBUG: database system is ready
この時点では
$ ps
PID PPID PGID WINPID TTY UID STIME COMMAND
328 1 328 328 con 500 01:58:01 /usr/bin/bash
1796 328 1796 872 con 500 02:23:51 /usr/local/bin/ipc-daemon
1832 328 1832 1944 con 500 02:27:59 /usr/local/pgsql/bin/postgres
1952 1832 1832 1952 con 500 02:28:03 /usr/local/pgsql/bin/postgres
1928 1952 1832 1928 con 500 02:28:03 /usr/local/pgsql/bin/postgres
1940 328 1940 352 con 500 02:39:06 /usr/bin/ps
$ ipcs
---------- Shared Memory Segments --------
shmid key bytes nattch status
_shm 0 5432001 1441792 1
---------- Semaphore Arrays --------
semid nsems key
_sem 1792 17 5432001 currents: 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 537
_sem 1793 17 5432002 currents: 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 537
_sem 1794 17 5432003 currents: 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 537
---------- Message Queues --------
msqid used-bytes messages
となっており,正しく動作しているように思えます.
しかしながら,psql を実行すると,次のようなエラーが生じて終了します.
$ psql template1
DEBUG: pq_recvbuf: recv() failed: Socket operation on non-socket
DEBUG: incomplete startup packet
psql: server closed the connection unexpectedly
This probably means the server terminated abnormally
before or while processing the request.
ちなみに,環境変数に PGHOST 127.0.0.1 を追加し,postgresql.conf を修正して
tcpip_socket = true
port = 5432
としても同様のエラーが生じました.
また,本メーリングリストのアーカイブも調べたのですが,解決法を見出せずにおります.
本問題を解決するための方法等をご教授いただけますようお願い申し上げます.
__________________________________________________
Do You Yahoo!?
Yahoo! BB is Broadband by Yahoo! http://bb.yahoo.co.jp/
pgsql-jp メーリングリストの案内