どうもこんにちわ。

なかなか遅々として記事が書けませんがそんな中続き。

先に言っておきますと

  • 家の環境 ... Windows7+Ubuntsu11.04のデュアルブート
  • 会社の開発環境 ... Windows7+Virtualbox+Ubuntsu11.04のブリッジ接続

ってな感じになっております。

この開発環境を作るってのがまた骨でして…ネットワークとか構築とか難しいですよね。超嫌い。

まま、そんな中postgres9.0.4を入れ、hstoreも一緒に入れてみました。

前回の記事で言っていた通り、パッケージマネージャからじゃなく、apt-getでいれないとダメですね。現状 > postgres9.0.4

多分ここ見ながらいれればいいんじゃないかなー。http://www.dctrwatson.com/2010/09/installing-postgresql-9-0-on-ubuntu-10-04/

以下、ログ

root@kmori-VirtualBox:/var/lib/postgresql# apt-get install postgresql-8.4-hstore-new

パッケージリストを読み込んでいます... 完了

依存関係ツリーを作成しています

状態情報を読み取っています... 完了

以下の特別パッケージがインストールされます:

postgresql-8.4 postgresql-client-8.4

提案パッケージ:

oidentd ident-server postgresql-doc-8.4

以下のパッケージが新たにインストールされます:

postgresql-8.4 postgresql-8.4-hstore-new postgresql-client-8.4

アップグレード: 0 個、新規インストール: 3 個、削除: 0 個、保留: 0 個。

4,660 kB のアーカイブを取得する必要があります。

この操作後に追加で 12.2 MB のディスク容量が消費されます。

続行しますか [Y/n]? y

取得:1 http://jp.archive.ubuntu.com/ubuntu/ natty/main postgresql-client-8.4 i386 8.4.8-0ubuntu0.11.04 [780 kB]

取得:2 http://jp.archive.ubuntu.com/ubuntu/ natty/main postgresql-8.4 i386 8.4.8-0ubuntu0.11.04 [3,852 kB]

取得:3 http://jp.archive.ubuntu.com/ubuntu/ natty/universe postgresql-8.4-hstore-new i386 1.0-2.1 [27.4 kB]

4,660 kB を 3秒 で取得しました (1,274 kB/s)

未選択パッケージ postgresql-client-8.4 を選択しています。

(データベースを読み込んでいます ... 現在 135595 個のファイルとディレクトリがインストールされています。)

(.../postgresql-client-8.4_8.4.8-0ubuntu0.11.04_i386.deb から) postgresql-client-8.4 を展開しています...

未選択パッケージ postgresql-8.4 を選択しています。

(.../postgresql-8.4_8.4.8-0ubuntu0.11.04_i386.deb から) postgresql-8.4 を展開しています...

未選択パッケージ postgresql-8.4-hstore-new を選択しています。

(.../postgresql-8.4-hstore-new_1.0-2.1_i386.deb から) postgresql-8.4-hstore-new を展開しています...

postgresql-client-8.4 (8.4.8-0ubuntu0.11.04) を設定しています ...

postgresql-8.4 (8.4.8-0ubuntu0.11.04) を設定しています ...

Creating new cluster (configuration: /etc/postgresql/8.4/main, data: /var/lib/postgresql/8.4/main)...

Moving configuration file /var/lib/postgresql/8.4/main/postgresql.conf to /etc/postgresql/8.4/main...

Moving configuration file /var/lib/postgresql/8.4/main/pg_hba.conf to /etc/postgresql/8.4/main...

Moving configuration file /var/lib/postgresql/8.4/main/pg_ident.conf to /etc/postgresql/8.4/main...

Configuring postgresql.conf to use port 5433...

* Starting PostgreSQL 8.4 database server [ OK ]

postgresql-8.4-hstore-new (1.0-2.1) を設定しています ...

root@kmori-VirtualBox:/var/lib/postgresql#

あ、はいったぽい。あれ?

* Starting PostgreSQL 8.4 database server [ OK ]

とかいってんな…

postgres@kmori-VirtualBox:~$ psql testdb

psql (9.0.4)

"help" でヘルプを表示します.

testdb=#

クライアントは9.0.4だな。サーバ側だけ8.4で動いてんのかな。

postgres 754 0.0 1.1 48584 5740 ? S 19:43 0:02 /usr/lib/postgresql/9.0/bin/postgres -D /var/lib/postgresql/9.0/main -c config_file=/etc/postgresql/9.0/main/postgresql.conf

postgres 820 0.1 0.5 48712 2560 ? Ss 19:43 0:05 \_ postgres: writer process

postgres 821 0.1 0.2 48584 1476 ? Ss 19:43 0:06 \_ postgres: wal writer process

postgres 823 0.0 0.4 49112 2400 ? Ss 19:43 0:01 \_ postgres: autovacuum launcher process

postgres 824 0.0 0.2 16800 1384 ? Ss 19:43 0:01 \_ postgres: stats collector process

postgres 3082 0.1 1.1 48440 5800 ? S 20:40 0:01 /usr/lib/postgresql/8.4/bin/postgres -D /var/lib/postgresql/8.4/main -c config_file=/etc/postgresql/8.4/main/postgresql.conf

postgres 3084 0.0 0.3 48440 1544 ? Ss 20:40 0:00 \_ postgres: writer process

postgres 3085 0.0 0.2 48440 1308 ? Ss 20:40 0:01 \_ postgres: wal writer process

postgres 3086 0.0 0.3 48572 1788 ? Ss 20:40 0:00 \_ postgres: autovacuum launcher process

postgres 3087 0.0 0.2 16748 1408 ? Ss 20:40 0:00 \_ postgres: stats collector process

2個いるやん!じゃあ、8.4だけでいいわ。とりあえず。

postgres@kmori-VirtualBox:~$ /etc/init.d/postgresql stop

* Stopping PostgreSQL 8.4 database server [ OK ]

* Stopping PostgreSQL 9.0 database server [ OK ]

/etc/init.d/postgresql みると第二引数でバージョン書けば指定して起動できるみたいよ。

postgres@kmori-VirtualBox:~$ /etc/init.d/postgresql start 8.4

* Starting PostgreSQL 8.4 database server [ OK ]

確認してみる。

postgres@kmori-VirtualBox:~$ ps auxwwf | fgrep postgres

postgres 2062 0.0 0.2 6112 1408 pts/0 S 20:32 0:00 \_ su - postgres

postgres 2070 0.6 2.0 14484 10176 pts/0 S 20:32 0:13 \_ -su

postgres 3138 0.0 0.2 6112 1408 pts/0 S 20:41 0:00 \_ su postgres

postgres 3145 0.0 0.3 6296 1992 pts/0 S 20:41 0:00 \_ bash

postgres 3539 0.0 0.2 5672 1108 pts/0 R+ 21:03 0:00 \_ ps auxwwf

postgres 3540 0.0 0.1 5072 756 pts/0 S+ 21:03 0:00 \_ fgrep postgres

postgres 3520 24.8 1.1 48436 5788 ? S 21:03 0:02 /usr/lib/postgresql/8.4/bin/postgres -D /var/lib/postgresql/8.4/main -c config_file=/etc/postgresql/8.4/main/postgresql.conf

postgres 3524 0.2 0.2 48436 1308 ? Ss 21:03 0:00 \_ postgres: writer process

postgres 3525 0.0 0.2 48436 1304 ? Ss 21:03 0:00 \_ postgres: wal writer process

postgres 3526 0.0 0.3 48568 1732 ? Ss 21:03 0:00 \_ postgres: autovacuum launcher process

postgres 3527 0.2 0.2 16744 1380 ? Ss 21:03 0:00 \_ postgres: stats collector process

postgres@kmori-VirtualBox:~$

OKOK。

んじゃhstoreつっこんでみよかー。

postgres@kmori-VirtualBox:~$ psql testdb -f /usr/share/postgresql/8.4/contrib/hstore-new.sql

BEGIN

SET

CREATE TYPE

psql:/usr/share/postgresql/8.4/contrib/hstore-new.sql:18: NOTICE: 戻り値型hstoreは単なるシェルです

psql:/usr/share/postgresql/8.4/contrib/hstore-new.sql:18: ERROR: ファイル"$libdir/hstore-new"にアクセスできませんでした: そのようなファイルやディレクトリはありません

psql:/usr/share/postgresql/8.4/contrib/hstore-new.sql:23: ERROR: 現在のトランザクションがアボートしました。トランザクションブロックが終わるまでコマンドは無視されます

(省略)

HINT: データ型を更新してください

psql:/usr/share/postgresql/8.4/contrib/hstore-new.sql:515: ERROR: 現在のトランザクションがアボートしました。トランザクションブロックが終わるまでコマンドは無視されます

ROLLBACK

アボートしたー。もうー。

とりあえず9.0のcontribも行っておく。

kenichiro@ubuntu:~$ sudo apt-get install -y postgresql-9.0 postgresql-server-dev-9.0 postgresql-contrib-9.0

※注 これは家の環境のものをコピってるだけなので、ホストだとかユーザ名が違うのですが気にしないでください。

postgres@kmori-VirtualBox:~$ psql -U postgres -d testdb -f /usr/share/postgresql/9.0/contrib/hstore.sql

SET

CREATE TYPE

psql:/usr/share/postgresql/9.0/contrib/hstore.sql:11: NOTICE: 戻り値型hstoreは単なるシェルです

CREATE FUNCTION

psql:/usr/share/postgresql/9.0/contrib/hstore.sql:16: NOTICE: 引数型hstoreは単なるシェルです

CREATE FUNCTION

psql:/usr/share/postgresql/9.0/contrib/hstore.sql:21: NOTICE: 戻り値型hstoreは単なるシェルです

CREATE FUNCTION

psql:/usr/share/postgresql/9.0/contrib/hstore.sql:26: NOTICE: 引数型hstoreは単なるシェルです

CREATE FUNCTION

CREATE TYPE

CREATE FUNCTION

CREATE FUNCTION

CREATE OPERATOR

(省略)

CREATE FUNCTION

CREATE FUNCTION

CREATE FUNCTION

CREATE FUNCTION

CREATE OPERATOR CLASS

CREATE FUNCTION

CREATE FUNCTION

CREATE FUNCTION

CREATE OPERATOR CLASS

あ。今度ははいったっぽいな。-U指定しないとダメだったか。postgresユーザのままだったからいらないと思ったけど。

ちょっとここまで書いて思ったんだけど、な が い。

ので、いちじここで止め。次回ようやくデータで遊ぶ予定なり。

ひっぱりすぎとかやめてえ。そんなつもりないんですわ。

Add Comments

名前
 
  絵文字
 
 
プロフィール

john_doe_

Twitter
instagram(SnapWidget)
タグクラウド
  • ライブドアブログ