PostgreSQL 9.0.2 install
PostgreSQL 9.0.2 を入れてみる。OSはCentOS。。。なんやったっけ。kernel はこれだな。2.6.18-194.26.1.el5 #1 SMP Tue Nov 9 12:54:40 EST 2010 i686 i686 i386 GNU/Linux[root@test_sv src]# cd /usr/local/src今時は珍しい、RingServer に ftp で突入。[root@test_sv src]# ftp ftp.ring.gr.jpConnected to ftp.ring.gr.jp.220 ring.shibaura-it.ac.jp FTP server (Version wu-2.6.2(1) Fri Aug 25 09:44:13 JST 2006) ready.530 Please login with USER and PASS.530 Please login with USER and PASS.KERBEROS_V4 rejected as an authentication typeName (ftp.ring.gr.jp:root): anymous331 Password required for anymous.Password:530 Login incorrect.Login failed.ftp> user anonymous331 Guest login ok, send your complete e-mail address as password.Password:[会社垢]230-230- ##################################################230- # Welcome to the RingServer FTP service. #230- ##################################################230-230- Localtime [Mon Jan 17 17:13:33 2011 JST+0900]230- Current [2] users / Max [100] users230-230-230 Guest login ok, access restrictions apply.ftp> cd /pub250 CWD command successful.ftp> ls227 Entering Passive Mode (202,18,64,24,34,100)150 Opening ASCII mode data connection for directory listing.total 72lrwxr-xr-x 1 root 1004 14 Jul 19 2006 CPAN -> lang/perl/CPANdrwxr-xr-x 279 1004 1004 6656 Jan 16 09:53 GNUdrwxr-xr-x 15 1004 1004 512 Jan 11 16:35 NetBSDdrwxr-xr-x 12 1004 1004 512 Jan 17 00:05 OpenBSDdrwxr-xr-x 5 104 104 512 Jun 25 2005 Xdrwxr-xr-x 24 1004 1004 512 Dec 17 2008 XFree86drwxr-xr-x 5 104 104 512 Jun 24 2005 docdrwxr-xr-x 17 1004 1004 512 Dec 8 2004 elispdrwxr-xr-x 8 104 104 512 Jun 24 2005 graphicsdrwxr-xr-x 5 104 104 512 Jun 24 2005 langdrwxr-xr-x 13 root root 512 Apr 1 2008 linuxdrwxr-xr-x 2 104 104 512 Aug 1 2007 macdrwxr-xr-x 11 104 104 512 Dec 7 2005 miscdrwxr-xr-x 23 104 104 512 Dec 5 2008 netdrwxr-xr-x 6 104 104 512 Jun 23 2008 pcdrwxr-xr-x 5 104 104 512 Nov 24 2005 text226 Transfer complete.ftp> cd /pub/misc/db/postgresql/source/v9.0.2250 CWD command successful.ftp> bin200 Type set to I.ftp> get postgresql-9.0.2.tar.gzlocal: postgresql-9.0.2.tar.gz remote: postgresql-9.0.2.tar.gz227 Entering Passive Mode (202,18,64,24,34,191)150 Opening BINARY mode data connection for postgresql-9.0.2.tar.gz (18319339 bytes).226 Transfer complete.18319339 bytes received in 4.7 seconds (3.8e+03 Kbytes/s)ftp> bye221-You have transferred 18319339 bytes in 0 files.LD 18319339 files 0221-Total traffic for this session was 18321376 bytes in 0 transfers.LD 18321445 files 0221-Thank you for using the FTP service on ring.shibaura-it.ac.jp.221 Goodbye.[root@test_sv src]# tar xvfz ./postgresql-9.0.2.tar.gzdefault で構築してみる。[root@test_sv src]# cd postgresql-9.0.2[root@test_sv postgresql-9.0.2]# ./configure[root@test_sv postgresql-9.0.2]# useradd postgres[root@test_sv postgresql-9.0.2]# su - postgres[postgres@test_sv postgresql-9.0.2]$ cd /usr/local/src/postgresql-9.0.2[postgres@test_sv postgresql-9.0.2]$ make[postgres@test_sv postgresql-9.0.2]$ make check[postgres@test_sv postgresql-9.0.2]$ exit[root@test_sv postgresql-9.0.2]# make install[root@test_sv postgresql-9.0.2]#スタート用のRunCommand の準備[root@test_sv postgresql-9.0.2]# cp -pi contrib/start-scripts/linux /etc/rc.d/init.d/pgsql[root@test_sv postgresql-9.0.2]# chmod 755 /etc/rc.d/init.d/pgsqlエディタで3行目を確認# chkconfig: 2345 98 02よしよし。ついでに PG_DATA も確認PGDATA="/usr/local/pgsql/data"さよけーこれが気にいらんかったら、configure の時に指定したれば良い。root@test_sv postgresql-9.0.2]# ./configure --prefix=/var/lib/pgsqlってな具合。[root@test_sv postgresql-9.0.2]# chkconfig --add pgsql[root@test_sv postgresql-9.0.2]# chkconfig --list pgsqlpgsql 0:off 1:off 2:on 3:on 4:on 5:on 6:off[root@test_sv postgresql-9.0.2]#[root@test_sv postgresql-9.0.2]# pushd /usr/local[root@test_sv local]# chown -R postgres.postgres pgsql[root@test_sv postgresql-9.0.2]# su - postgres[postgres@test_sv ~]$ /usr/local/pgsql/bin/initdb -D /usr/local/pgsql/dataThe 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-8The default text search configuration will be set to "simple".creating directory /usr/local/pgsql/data ... okcreating subdirectories ... okselecting default max_connections ... 100selecting default shared_buffers ... 32MBcreating configuration files ... okcreating template1 database in /usr/local/pgsql/data/base/1 ... okinitializing pg_authid ... okinitializing dependencies ... okcreating system views ... okloading system objects' descriptions ... okcreating conversions ... okcreating dictionaries ... oksetting privileges on built-in objects ... okcreating information schema ... okloading PL/pgSQL server-side language ... okvacuuming database template1 ... okcopying template1 to template0 ... okcopying template1 to postgres ... okWARNING: enabling "trust" authentication for local connectionsYou can change this by editing pg_hba.conf or using the -A option thenext time you run initdb.Success. You can now start the database server using: /usr/local/pgsql/bin/postgres -D /usr/local/pgsql/dataor /usr/local/pgsql/bin/pg_ctl -D /usr/local/pgsql/data -l logfile start[postgres@test_sv ~]$ exit[root@test_sv local]# /etc/rc.d/init.d/pgsql startStarting PostgreSQL: ok[root@test_sv local]#まぁ、とりあえずこれでいっか。