2
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

PostgreSQLをビルドする(Win10 x64)

Last updated at Posted at 2017-04-18

趣旨

仕事で提案する前提でPostgreSQLを勉強することにしたんですが、Windows版の公式ビルド(zip/exe)の再頒布ライセンスが明確に説明されていなかった(見つけられなかった?)ので怖くて使えず、自分でビルドする所から始めてみることにしました。

環境

この記事では、最小要件(config.pl無変更)かつx64ネイティブのみを対象とします。

systeminfo
OS 名:                  Microsoft Windows 10 Pro
OS バージョン:          10.0.14393 N/A ビルド 14393
OS 製造元:              Microsoft Corporation
OS 構成:                スタンドアロン ワークステーション
OS ビルドの種類:        Multiprocessor Free
システム製造元:         Microsoft Corporation
システム モデル:        Virtual Machine
システムの種類:         x64-based PC
プロセッサ:             1 プロセッサインストール済みです。
                        [01]: Intel64 Family 6 Model 60 Stepping 3 GenuineIntel ~3200 Mhz
BIOS バージョン:        Microsoft Corporation Hyper-V UEFI Release v1.0, 2012/11/26
システム ロケール:      ja;日本語
入力ロケール:           ja;日本語
タイム ゾーン:          (UTC+09:00) 大阪、札幌、東京
Hyper-V の要件:         ハイパーバイザーが検出されました。Hyper-V に必要な機能は表示されません。

1. 必要なファイルをダウンロードする

2. 開発環境を整備する

1. Visual C++ 2015 Build Tools をインストール

vc2015bt.png

PostgreSQLのビルドではWindows SDKを使用する為、「Windows 8.1 SDK」も追加機能として選択する必要があります。

2. Visual C++ Build Tools 2015 Update 3 をインストール

コンパイラやライブラリなどのバグ修正が含まれているため、同時に済ませておきます。

3. Diff をインストール

diffutils.png

インストール先のbinフォルダを PATH 環境変数に追記する必要がある為、このパスは控えておいて下さい。
完了後、PATH 環境変数に追記します。

path.png

4. Strawberry Perl を展開

ポータブル版の場合、PostgreSQLをビルドする前に portableshell.bat を実行する必要がある為、
展開したパスを控えておいて下さい。

5. PostgreSQL を展開/ビルド

展開後、スタート メニューからVisual C++ 2015 x64 Native Build Tools Command Promptを実行し、
作業フォルダを[PostgreSQL]src\tools\msvcに変更します。

config_default.pl を、 config.pl にコピーします。

[StrawberryPerl]portableshell.bat を実行し、Perlへのパスを通します。

build を実行すると、ビルドステップが開始されます。

完了後、 install [好きな場所] を実行すると、 pg_ から始まる各種ツールや、
includelib などのフォルダが生成されます。

psql.png

参考

2
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?