Navigation Menu

Skip to content

Commit

Permalink
Add document about installing on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
kou committed Apr 28, 2015
1 parent e689e3a commit 44129ae
Showing 1 changed file with 103 additions and 3 deletions.
106 changes: 103 additions & 3 deletions README.md
Expand Up @@ -58,6 +58,8 @@ pg\_trgmとpg\_bigmが使っているGINやGiSTが対応しています。)
* CentOS 5
* CentOS 6
* CentOS 7
* Windows 32bit + PostgreSQL 9.4.1
* Windows 64bit + PostgreSQL 9.4.1

その他の環境ではソースからインストールしてください。

Expand Down Expand Up @@ -157,12 +159,47 @@ PostgreSQLを起動します。

これでインストールは完了です。

### ソースからインストール
### Windowsにインストール

PostgreSQLをインストールします。
[インストーラーバージョン](http://www.enterprisedb.com/products-services-training/pgdownload)
でも
[zipバージョン](http://www.enterprisedb.com/products-services-training/pgbindownload)
でも構いません。

PGroongaのパッケージをダウンロードします。

* [32bit版](http://packages.groonga.org/windows/pgroonga/pgroonga-0.5.0-x86.zip)
* [64bit版](http://packages.groonga.org/windows/pgroonga/pgroonga-0.5.0-x64.zip)

PGroongaのパッケージを展開します。展開先としてPostgreSQLのフォルダーを
指定します。PostgreSQLのフォルダーはインストーラーを使ってPostgreSQLを
インストールした場合は`C:\Program Files\PostgreSQL\9.4`です。zipを使っ
てインストールした場合は`%アーカイブを展開したフォルダー%\pgsql`です。

データベースを作成します。

postgres=# CREATE DATABASE pgroonga_test;

データベースに接続して`CREATE EXTENSION pgroonga`を実行します。

postgres=# \c pgroonga_test
pgroonga_test=# CREATE EXTENSION pgroonga;

これでインストールは完了です。

[Groongaをインストール](http://groonga.org/ja/docs/install.html)します。
パッケージでのインストールがオススメです。
### ソースからインストール

Windowsの場合とそれ以外の場合でソースからのインストール方法が違います。

まず、Windows以外の場合を説明し、その後、Windowsの場合を説明します。

#### Windows以外の場合

まずPostgreSQLをインストールします。

次に[Groongaをインストール](http://groonga.org/ja/docs/install.html)
ます。パッケージでのインストールがオススメです。

パッケージでインストールするときは次のパッケージをインストールしてください。

Expand All @@ -187,10 +224,73 @@ PGroongaをビルドしてインストールします。
% make
% sudo make install

データベースを作成します。

% psql --command 'CREATE DATABASE pgroonga_test'

(ここで`pgroonga_test`用のユーザーを作成して、そのユーザーで接続する
べき。)

データベースに接続して`CREATE EXTENSION pgroonga`を実行します。

% psql -d db --command 'CREATE EXTENSION pgroonga;'

これでインストールは完了です。

#### Windowsの場合

Windowsでソースからインストールするために必要なものは次の通りです。ま
ずはこれらをインストールしてください。

* PostgreSQL(インストーラーバージョンでもzipバージョンでも構いません。)
* [インストーラーバージョン](http://www.enterprisedb.com/products-services-training/pgdownload)
* [zipバージョン](http://www.enterprisedb.com/products-services-training/pgbindownload)
* [Microsoft Visual Studio Express 2013 for Windows Desktop](https://www.visualstudio.com/downloads/#d-2013-express)
* [CMake](http://www.cmake.org/)

次にWindows用のPGroongaのソースアーカイブをpackages.groonga.orgからダ
ウンロードしてください。zipがWindows用のソースアーカイブです。Windows
用のソースアーカイブにはGroongaがバンドルされています。

* http://packages.groonga.org/source/pgroonga/pgroonga-0.5.0.zip

ソースアーカイブを展開し、ソースフォルダーへ移動します。

> cd c:\Users\%USERNAME%\Downloads\pgroonga-0.5.0

`cmake`でビルドオプションを設定します。以下のコマンドラインは64bit用の
PostgreSQL用にビルドするためのものです。32bit用のPostgreSQL用にをビル
ドする場合は代わりに`-G "Visual Studio 12 2013"`パラメーターを指定して
ください。

pgroonga-0.5.0> cmake . -G "Visual Studio 12 2013 Win64" -DCMAKE_INSTALL_PREFIX=%PostgreSQLをインストールしたフォルダー%

`%PostgreSQLをインストールしたフォルダー%`はインストーラーを使って
PostgreSQLをインストールした場合は`C:\Program Files\PostgreSQL\9.4`
す。zipを使ってインストールした場合は`%アーカイブを展開したフォルダー
%\pgsql`です。

ビルドします。

pgroonga-0.5.0> cmake --build . --config Release

インストールします。インストールする場所によっては管理者権限が必要にな
ります。(PostgreSQLをインストーラーでインストールしている場合は管理者
権限が必要でしょう。)

pgroonga-0.5.0> cmake --build . --config Release --target Install

データベースを作成します。

postgres=# CREATE DATABASE pgroonga_test;

データベースに接続して`CREATE EXTENSION pgroonga`を実行します。

postgres=# \c pgroonga_test
pgroonga_test=# CREATE EXTENSION pgroonga;

これでインストールは完了です。

## 使い方

PGroongaは全文検索はもちろん、数値や文字列の等価条件(`=`)や比較条件
Expand Down

0 comments on commit 44129ae

Please sign in to comment.