ArcGIS Desktop

  • ArcGIS Pro
  • ArcMap

  • My Profile
  • Help
  • Sign Out
ArcGIS Desktop

ArcGIS Online

The mapping platform for your organization

ArcGIS Desktop

A complete professional GIS

ArcGIS Enterprise

GIS in your enterprise

ArcGIS for Developers

Tools to build location-aware apps

ArcGIS Solutions

Free template maps and apps for your industry

ArcGIS Marketplace

Get apps and data for your organization

  • Documentation
  • Support
Esri
  • Sign In
user
  • My Profile
  • Sign Out

Help

  • Home
  • Get Started
  • Map
  • Analyze
  • Manage Data
  • Tools
  • More...

Configure a PostgreSQL database cluster to accept connections

  • PostgreSQL is installed on a Linux server
  • PostgreSQL is installed on a Windows server

By default, only clients running on the same machine as the PostgreSQL database cluster can connect to it. To allow remote clients to connect to the database cluster, alter the PostgreSQL pg_hba.conf configuration file.

Follow the instructions specific to the operating system where PostgreSQL is installed.

PostgreSQL is installed on a Linux server

  1. Make a backup copy of the pg_hba.conf file before you alter it.
  2. If the PostgreSQL postmaster is already running, stop it using the pg_ctl stop command.
  3. Open the pg_hba.conf file in a text editor.
  4. Add the IP addresses of connecting client machines and the client authentication methods used for connections.

    For example, to allow any user who supplies a valid password to connect to a database named habitat from addresses beginning with 10.2.12 using an md5 connection, add the following line to the pg_hba.conf file:

    host habitat all 10.2.12.0/24 md5
    

    If you want to allow all users who supply a valid password to connect to any of the databases on the PostgreSQL instance from addresses beginning with 100, you would add a line similar to the following to the pg_hba.conf file:

    host all all 100.0.0.0/8 md5
    

    The preceding examples were for IPV4 addresses. If you need to configure the database cluster to accept connections from machines with an IPV6 address, the format would be as follows:

    host all all fe60::61f9:1253:c522:9b92%10/128 md5
    

    To allow any machines with an address beginning with fe60 to connect, you would add this line to the pg_hba.conf file:

    host all all fe60::0000:0000:0000:0000%10/8 md5

    If your PostgreSQL database cluster is set up on a machine that has an IPV6 address and you want machines with an IPV4 address to connect to it, you need to uncomment the following line in the pg_hba.conf file:

    host all all ::1/128 md5
    

  5. Save and close the pg_hba.conf file.
  6. Use pg_ctl to start (or restart) the PostgreSQL postmaster.

PostgreSQL is installed on a Windows server

You can either alter the pg_hba.conf file directly by opening it in a text editor, or you can alter the pg_hba.conf file through PgAdminIII.

  1. Make a backup copy of the pg_hba.conf file before you alter it.
  2. Open the pg_hba.conf file by doing one of the following:
    • Start PgAdminIII, connect to the PostgreSQL instance as the postgres super user, connect to the database, click Tools, point to Server Configuration, then click pg_hba.conf.
    • Start Notepad or another text editor application and open the pg_hba.conf file from the PostgreSQL installation directory.
  3. Add the IP addresses of connecting client machines and the client authentication methods used for connections.

    For example, to allow any user who supplies a valid password to connect to a database named habitat from addresses beginning with 10.2.12 using an md5 connection, add the following line to the pg_hba.conf file:

    host habitat all 10.2.12.0/24 md5
    

    If you want to allow all users who supply a valid password to connect to any of the databases on the PostgreSQL instance from addresses beginning with 100, you would add a line similar to the following to the pg_hba.conf file:

    host all all 100.0.0.0/8 md5
    

    The preceding examples were for IPV4 addresses. If you need to configure the database cluster to accept connections from machines with an IPV6 address, the format would be as follows:

    host all all fe60::61f9:1253:c522:9b92%10/128 md5
    

    To allow any machines with an address beginning with fe60 to connect, you would add this line to the pg_hba.conf file:

    host all all fe60::0000:0000:0000:0000%10/8 md5

    If your PostgreSQL database cluster is set up on a machine that has an IPV6 address and you want machines with an IPV4 address to connect to it, you need to uncomment the following line in the pg_hba.conf file:

    host all all ::1/128 md5
    

  4. Save the changes you made to the file and close it.

ArcGIS Desktop

  • Home
  • Documentation
  • Support

ArcGIS Platform

  • ArcGIS Online
  • ArcGIS Desktop
  • ArcGIS Enterprise
  • ArcGIS for Developers
  • ArcGIS Solutions
  • ArcGIS Marketplace

About Esri

  • About Us
  • Careers
  • Esri Blog
  • User Conference
  • Developer Summit
Esri
Tell us what you think.
Copyright © 2019 Esri. | Privacy | Legal