Movatterモバイル変換


[0]ホーム

URL:



Facebook
Postgres Pro
Facebook
Downloads
16.2. InstallingPostgres Pro Standard on Windows
Prev UpChapter 16. Binary InstallationHome Next

16.2. InstallingPostgres Pro Standard on Windows

Postgres Pro offers the following installation modes for the supported Windows systems:

Additionally, you have to set up the environment for using PL/Perl and PL/Python, if these procedural languages are required for your purposes. For details, seeSection 16.2.4.

To avoid confusion, note that there are the following different users on Windows systems:

  • Postgres Pro installation is performed on behalf of an operating system user. All the database files belong to this user.

  • You must connect to the database cluster on behalf of the user created at installation time to be able to work with the database. This is not an operating system user.

  • By default,Postgres Pro service is started on behalf ofNT AUTHORITY\NetworkService, which is a special Windows Service Account. You can specify another Windows user for startingPostgres Pro service in the corresponding text box of the installer, if required. The provided user must have the right to start Windows services.

The minimum hardware required to installPostgres Pro, create a database cluster and start the database server are as follows:

  • 1-GHz processor

  • 1 GB of RAM

  • 1 GB of disk space

Additional disk space is required for data or supporting components.

16.2.1. Supported Windows Versions

Postgres Pro is available for the following 64-bit Windows versions:

  • Windows 10 or higher

  • Windows Server 2012 R2 or higher

16.2.2. GUI Installation

Postgres Pro provides an installer with an interactive wizard that configures and installsPostgres Pro core components, creates the default database, and enables server autostart. The following components have their own installers that should be run separately once the core components are installed:

  • pg_probackup

To installPostgres Pro core components, run the provided installer as administrator and follow the on-screen instructions. Make sure to take into account the following installation specifics:

  • You can install all thePostgres Pro core components, or customize the installation by excluding server or developer components. Client utilities are always installed.

  • The selected data directory must be empty. Otherwise,Postgres Pro cannot create the default database. The default data directory isC:\Program Files\PostgresPro\11\data.

  • If theAllow external connections check box is selected (default), the installer modifiespostgresql.conf andpg_hba.conf files to allow external connections. Otherwise,Postgres Pro server is listening for connections from the localhost only. If you decide to enable external connections when the installation is complete, you have to modify the Windows Firewall configuration to allowPostgres Pro server to accept connections.

  • Make sure to remember the username and password you set up when installingPostgres Pro as it will be required to connect to thePostgres Pro server when using password-based authentication methods.

  • By default,Postgres Pro usesicu collations. If you are upgrading an installation with the default collation provided bylibc, such asPostgreSQL, make sure to chooselibc collation provider in the corresponding drop-down list of the installer.

  • Postgres Pro provides a pre-configuredpsql that you can launch from the Start menu, so you do not have to configure the standard environment variables. However, if you would like to work withPostgres Pro from the standard command prompt without specifying full paths to the binary files, select theSet up environment variables check box.

Once the installation completes, yourPostgres Pro instance is ready to use, with server autostart enabled. If you need more than onePostgres Pro instance on the same system, you have to configure them manually. For details, seeSection 16.2.5.

16.2.3. Command-Line Installation

To installPostgres Pro from the command line, run the downloaded installer file passing one or more options described inSection 16.2.3.1.

16.2.3.1. Command-Line Options

Installation directory path:

/D=path

Silent install:

/S

INI file that provides the options to customize the server installation:

/init=ini_file_name

If you would like to customize the installation, you must create theINI file manually, as described inSection 16.2.3.2.

16.2.3.2. INI File Format

You can add the following installation options to the [options] section of the INI file:

  • InstallDir — path where to install server. If you specified the /D option on the command line, it will be overwritten by theInstallDir value.

  • DataDir — path where to create default database

  • Port — TCP/IP port to listen. Default: 5432.

  • SuperUser — name of the database user who will have admin rights in the database

  • Password — password of the user

  • noExtConnections = 1 — do not allow external connections

  • Coding = UNICODE — character encoding to use in the database

  • Locale — locale to use in the database. There can be several different locales for each encoding

  • vcredist = no — do not install Visual C redistributable libraries (use it only if these libraries are already installed on your system)

  • envvar = 1 — set up environment variables helpful forPostgres Pro:PGDATA,PGDATABASE,PGUSER,PGPORT,PGLOCALEDIR

  • needoptimization = 0 — disable automatic tuning of configuration parameters based on the available system resources.

  • datachecksums = 0 — disable data checksums for the cluster.

  • serviceaccount — specify a Windows user for startingPostgres Pro service. The provided user must have the right to start Windows services. By default,Postgres Pro service is started on behalf ofNT AUTHORITY\NetworkService, which is a special Windows Service Account.

  • servicepassword — provide the password for the Windows user specified in theserviceaccount option.

  • serviceid — changePostgres Pro service name.

  • islibc = 1 — uselibc as the provider of the default collation.

16.2.4. Loading Procedural Languages

Postgres Pro distribution for Windows systems includesPL/Perl andPL/Python procedural languages.

16.2.4.1. Setting up the Environment for PL/Python

To configure the system for using PL/Python, complete the following steps:

  1. Download and install the latest available version of Python 3.8 or 2.7 for Windows. Choose the 64-bit version asPostgres Pro server has 64-bit architecture type. You can find the installers athttps://www.python.org/.

  2. Create the PL/Python extension by running the following command inpsql:

    CREATE EXTENSION plpythonu

Tip

In some cases, when you create a PL/Python function, the connection to the server is lost and the server log shows the following error message:

ImportError: module site not found

To avoid this issue, try to specify the Python installation directory in thePYTHONHOME environment variable and restart thePostgres Pro service.

16.2.4.2. Setting up the Environment for PL/Perl

To configure the system for using PL/Perl, complete the following steps:

  1. Download theMSI package of the 64-bit Strawberry Perl 5.26 fromhttps://strawberryperl.com/releases.html and perform the installation.

  2. Restart thePostgres Pro server.

  3. Create the PL/Perl extension by running the following command inpsql:

    CREATE EXTENSION plperlu

16.2.5. Configuring MultiplePostgres Pro Instances

To set up severalPostgres Pro server instances with different data directories on Windows, do the following:

  1. InstallPostgres Pro as explained inSection 16.2.2 orSection 16.2.3. The installed binary files are shared by allPostgres Pro instances, so you need to complete this step only once.

  2. Select an empty folder that your newPostgres Pro instance will use as the data directory. For example,C:\Program Files\PostgresPro\11\data2. Make sure to grant Full Control permissions for this folder to the current OS user that will own the database files and the user on behalf of which the server is running (NT AUTHORITY\NetworkService by default).

  3. Runinitdb specifying the path to the new data directory and any other parameters required to initialize another server instance. For example:

    "C:\Program Files\PostgresPro\11\bin\initdb.exe" --encoding=UTF8 -U "postgres" -D "C:\Program Files\PostgresPro\11\data2"

    Alternatively, you can stop the running server and copy the contents of the existing data directory into the newly created folder. In this case, the newPostgres Pro instance inherits all the settings of the original instance, including authentication settings.

  4. Modifypostgresql.conf settings for the newPostgres Pro instance as required. Make sure to specify different ports for your server instances to avoid conflicts.

  5. Open the command prompt as Administrator and register a newPostgres Pro service with a unique name, for example,postgrespro-data2:

    "C:\Program Files\PostgresPro\11\bin\pg_ctl.exe" register -N "postgrespro-data2" -U "NT AUTHORITY\NetworkService" -D "C:\Program Files\PostgresPro\11\data2" -w

    Start the registered service:

    sc start "postgrespro-data2"

Once the service is started, yourPostgres Pro instance is ready to use. If you need any additionalPostgres Pro extensions, make sure to enable them for the new instance as explained inSection 16.3.

16.2.6. UninstallingPostgres Pro Standard

The procedure of uninstallingPostgres Pro Standard depends on the number ofPostgres Pro instances set up on your system.

If you have a singlePostgres Pro instance created at installation time, you only need to run theC:\Program Files\PostgresPro\11\uninstall.exe program. This program automatically stops the server and unregisters the service for this instance.

If you have created any additionalPostgres Pro instances, you have to complete the following steps:

  1. Stop the server for each instance:

    "C:\Program Files\PostgresPro\11\bin\pg_ctl.exe" stop -D "C:\Program Files\PostgresPro\11\data_dir" -m fast -w

  2. Unregister the service for each instance:

    "C:\Program Files\PostgresPro\11\bin\pg_ctl.exe" unregister -N "postgrespro_service_name"

  3. Run theC:\Program Files\PostgresPro\11\uninstall.exe to uninstallPostgres Pro binary files.

16.2.7. Antivirus Considerations

It is strongly recommended to avoid using antivirus software on systems wherePostgres Pro is running because it may cause additional load on your environment and result in unexpected database behavior that would lead to performance and reliability issues. If you need to use antivirus software, make sure to exclude the following directories from virus scanning as they do not contain any executable files:

  • PGDATA directory that stores main cluster data, usually located inC:\Program Files\PostgresPro\11\data unless you specified another directory ininitdb options

  • Paths to createdtablespaces


Prev Up Next
16.1. InstallingPostgres Pro Standard on Linux Home 16.3. Installing Additional Supplied Modules
epubpdf
Go to Postgres Pro Standard 11
By continuing to browse this website, you agree to the use of cookies. Go toPrivacy Policy.

[8]ページ先頭

©2009-2025 Movatter.jp