バージョンごとのドキュメント一覧

第18章 Windowsにおけるソースコードからのインストール

目次

18.1. Visual C++またはMicrosoft Windows SDKを使用した構築
18.1.1. 必要条件
18.1.2. 64ビット版のWindowsにおける特別な考慮事項
18.1.3. 構築
18.1.4. 整理およびインストール
18.1.5. リグレッションテストの実行
<title>Installation from Source Code on <productname>Windows</productname></title>

It is recommended that most users download the binary distribution for Windows, available as a graphical installer package from the <productname>PostgreSQL</productname> website at <ulink url="https://www.postgresql.org/download/"></ulink>. Building from source is only intended for people developing <productname>PostgreSQL</productname> or extensions. ほとんどのユーザには、PostgreSQLウェブサイトのhttps://www.postgresql.org/download/からグラフィカルインストーラパッケージとして入手可能なWindows用のバイナリ配布物をダウンロードすることを推奨します。 ソースからの構築は、PostgreSQLそのもの、もしくはその拡張の開発者のみを対象としています。

There are several different ways of building PostgreSQL on <productname>Windows</productname>. The simplest way to build with Microsoft tools is to install <productname>Visual Studio 2022</productname> and use the included compiler. It is also possible to build with the full <productname>Microsoft Visual C++ 2015 to 2022</productname>. In some cases that requires the installation of the <productname>Windows SDK</productname> in addition to the compiler. WindowsでPostgreSQLを構築する方法は複数存在します。 Microsoftのツールを使用した最も単純な構築方法は、Visual Studio 2022をインストールし、それに含まれるコンパイラを使用することです。 また完全なMicrosoft Visual C++ 2015から2022までを使用しても構築できます。 コンパイラの他にWindows SDKのインストールが必要となる場合があります。

It is also possible to build PostgreSQL using the GNU compiler tools provided by <productname>MinGW</productname>, or using <productname>Cygwin</productname> for older versions of <productname>Windows</productname>. また、MinGWで提供されるGNUコンパイラツール、または、古めのWindowsではCygwinを使用してPostgreSQLを構築することができます。

Building using <productname>MinGW</productname> or <productname>Cygwin</productname> uses the normal build system, see <xref linkend="installation"/> and the specific notes in <xref linkend="installation-notes-mingw"/> and <xref linkend="installation-notes-cygwin"/>. To produce native 64 bit binaries in these environments, use the tools from <productname>MinGW-w64</productname>. These tools can also be used to cross-compile for 32 bit and 64 bit <productname>Windows</productname> targets on other hosts, such as <productname>Linux</productname> and <productname>macOS</productname>. <productname>Cygwin</productname> is not recommended for running a production server, and it should only be used for running on older versions of <productname>Windows</productname> where the native build does not work. The official binaries are built using <productname>Visual Studio</productname>. MinGWまたはCygwinを使用した構築では、通常の構築システムを使用します。 第17章17.7.4および17.7.2にある固有の注記を参照してください。 これらの環境で64ビットバイナリを生成するためにはMinGW-w64のツールを使用します。また、これらのツールは32ビットと64ビットWindows上で、LinuxmacOSなどの他のホストを対象としたクロスコンパイルをする際にも使用されます。 Cygwinは商用サーバでの稼働は推奨されません。 これは、ネイティブな構築ができない古めのバージョンのWindowsでの使用に限定してください。 公式のバイナリはVisual Studioを使用して構築しています。

Native builds of <application>psql</application> don't support command line editing. The <productname>Cygwin</productname> build does support command line editing, so it should be used where psql is needed for interactive use on <productname>Windows</productname>. psqlのネイティブな構築はコマンドライン編集をサポートしていません。 Cygwinによる構築はコマンドライン編集をサポートしているので、Windows上でインタラクティブなpsqlの振る舞いが必要になる場合はこちらを使うべきでしょう。