[pgsql-jp: 28967] Re: MacOSX でcreatedb のエラー

sugita @ sra.co.jp sugita @ sra.co.jp
2003年 2月 6日 (木) 21:21:59 JST


  杉田です。

From: "Yoichi Shimada" <yshim @ storgate.co.jp>
Subject: [pgsql-jp: 28966] Re: MacOSX でcreatedb のエラー
Date: Thu, 6 Feb 2003 20:42:27 +0900

;;;  MacOSX の話題、嬉しいです。

  Mac OS X ですね。

;;; 最新は 7.3.2 です。  以下ご参照あれ。
;;; 7.3.1 の方にはチョットショックかも。。

  ショックとは考えていませんでした。どこがショックなのでしょう。

;;; <http://www.postgresql.org/news.php?NewsID=128>
;;; 
;;; 私の環境
;;; 
;;; MacOS 10.2.3
;;; 
;;; $ gcc --version
;;; gcc (GCC) 3.1 20020420 (prerelease)
;;; Copyright (C) 2002 Free Software Foundation, Inc.
;;; This is free software; see the source for copying conditions.  There is NO
;;; warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
;;; 
;;; $ make --version
;;; GNU Make version 3.79, by Richard Stallman and Roland McGrath.
;;; Built for powerpc-apple-darwin6.0
;;; Copyright (C) 1988, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99
;;;         Free Software Foundation, Inc.
;;; This is free software; see the source for copying conditions.
;;; There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
;;; PARTICULAR PURPOSE.

  同じです。

;;; 早速、make , install してみました。
;;; 手順は以下の通りです。
;;; <http://developer.apple.com/internet/macosx/postgres.html>
;;; 
;;; また、configure 時に readline 関連で error がでたので
;;; 上記の手順内にあるように "Fink" をインストールし(1時間ほどかかった)
;;; <http://fink.sourceforge.net/news/jag-bootstrap.php>
;;; 
;;; fink install readline

  Fink の readline は、漢字が扱えたでしょうか。漢字が使える libreadline.4.1 を 
Mac OS X でコンパイルできるようにして使っています。

;;; としてから、再度 configure しました。(パラメータは以下)
;;; そして、 make all と root にて make install
;;; 
;;; [postgres]% pg_config --configure
;;; '--enable-multibyte' '--enable-syslog' '--with-includes=/sw/include/' '--
;;; with-libraries=/sw/lib'

  7.3 からデフォルトで --enable-multibyte と --enable-syslog が有効になってい
ます。私の configure は、以下のようです。

    #!/bin/sh

    CFLAGS=-O2 ./configure                  \
	--prefix=/opt/pgsql/7.3.1           \
	--with-tcl                          \
	--without-tk                        \
	--enable-integer-datetimes

;;; initdb ....

  initdb で、--encoding=EUC_JP --no-locale としておくのがよいと思います。--
no-locale を付けないとロケールが有効になってしまうので、ソートや検索などがうま
く行きません。

;;; [postgres]% pg_ctl -D /Volumes/Work/pgsql/data -l logfile start
;;; postmaster successfully started
;;; 
;;; [postgres] postgres% createdb test1
;;; CREATE DATABASE
;;; 
;;; [postgres] postgres% psql -l
;;;         List of databases
;;;    Name    |  Owner   | Encoding  
;;; -----------+----------+-----------
;;;  template0 | postgres | SQL_ASCII
;;;  template1 | postgres | SQL_ASCII
;;;  test1     | postgres | SQL_ASCII
;;; (3 rows)

  PostgreSQL の libpq は、共有ライブラリでなくローダブルなライブラリなので、
以下の => のように、libpq の .dylib を作り直して使っています。

    $ otool -L /opt/pgsql/7.3.1/bin/psql 
    /opt/pgsql/7.3.1/bin/psql:
=>	    libpq.3.0.dylib (compatibility version 3.0.0, current version 3.0.0)
	    /usr/lib/libz.1.1.3.dylib (compatibility version 1.0.0, current version 1.1.3)
	    /usr/local/lib/libreadline.4.1.dylib (compatibility version 4.0.0, current version 4.1.0)
	    /usr/local/lib/libdl.1.dylib (compatibility version 1.0.0, current version 1.0.0)
	    /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 63.0.0)
    $ otool -L /opt/qt-3.1.1/lib/libqt.3.1.1.dylib                    
    /opt/qt-3.1.1/lib/libqt.3.1.1.dylib:
	    @executable_path/../Frameworks/libqt.3.dylib (compatibility version 0.0.0, current version 0.0.0)
	    /System/Library/Frameworks/OpenGL.framework/Versions/A/OpenGL (compatibility version 1.0.0, current version 1.0.0)
	    /System/Library/Frameworks/AGL.framework/Versions/A/AGL (compatibility version 1.0.0, current version 1.0.0)
=>	    libpq.3.0.dylib (compatibility version 3.0.0, current version 3.0.0)
	    /System/Library/Frameworks/Carbon.framework/Versions/A/Carbon (compatibility version 2.0.0, current version 122.0.0)
	    /System/Library/Frameworks/QuickTime.framework/Versions/A/QuickTime (compatibility version 1.0.0, current version 172.0.0)
	    /usr/lib/libz.1.1.3.dylib (compatibility version 1.0.0, current version 1.1.3)
	    /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 63.0.0)
    $ 


Kenji Sugita                                      



pgsql-jp メーリングリストの案内