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 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

ArcMap

  • Home
  • Get Started
  • Map
  • Analyze
  • Manage Data
  • Tools
  • Extensions

Connect to PostgreSQL from ArcGIS

  • Connect from ArcMap
  • Connect from ArcGIS Server

To connect to PostgreSQL from ArcGIS clients, be sure PostgreSQL is configured to accept connections from your ArcGIS client machines and create an ArcGIS database connection.

To publish ArcGIS Server web services that reference the data in your PostgreSQL database, register the database connection file with your ArcGIS Server sites.

Connect from ArcMap

PostgreSQL client files are installed with ArcGIS Desktop. To connect from ArcMap, configure the database to accept connections, and create a database connection from the Catalog tree in ArcMap or ArcCatalog.

Configure the database to allow connections

Alter the PostgreSQL pg_hba.conf file and make sure the necessary login or group roles have CONNECT privileges in the database.

  1. Alter the PostgreSQL pg_hba.conf file on the database server to accept connections from the ArcGIS client machines.
  2. Restart PostgreSQL or force the postmaster to reload the pg_hba.conf file by running pg_ctl reload.
  3. Be sure users have privileges to connect to the database cluster.

    By default, Public has CONNECT privileges to the PostgreSQL database cluster; therefore, you only need to grant CONNECT to individual login or group roles if you revoked the CONNECT privilege from Public.

Connect to the database

You can connect to a database or geodatabase in PostgreSQL by adding a database connection under the Database Connections node in the Catalog tree in ArcMap or ArcCatalog.

  1. Expand Database Connections in the Catalog tree in ArcMap or ArcCatalog and double-click Add Database Connection.
  2. Choose PostgreSQL from the Database Platform drop-down list.
  3. In the Instance text box, type the database cluster name or IP address of the server where PostgreSQL is installed.

    For example, if your PostgreSQL database cluster is named ficus, type ficus in the Instance text box. If specifying an IPV6 address, enclose the address in brackets. For example, if the IPV6 address of the server is 1111:aa1:0:1:f111:a222:33f3:b4bb, type [1111:aa1:0:1:f111:a222:33f3:b4bb] in the Instance text box.

    Note:

    If your PostgreSQL database cluster is listening on a port other than the default (5432), include the port number in the instance. For example, if PostgreSQL is installed on server mamabear and is listening on port 49200, type mamabear,49200 in the Instance text box.

  4. Use Database authentication to connect.
  5. Provide the name and password of the login role with which you want to connect.
  6. Uncheck Save user name and password if you prefer not to save your login information as part of the connection; doing this can help maintain the security of the database. However, if you do this, you will be prompted to provide a user name and password every time you connect from desktop clients.

    Note:

    Save user name and password must be checked for connection files that provide ArcGIS web services with access to the database, or if you want to search ArcGIS Desktop to locate data accessed through this connection file.

  7. Type or choose the name of the database on the PostgreSQL database cluster to which you want to connect.

    In the following example, user1 is connecting to database floe on the tundra PostgreSQL database cluster:

    Example of a connection to a PostgreSQL database

  8. Click OK to connect.

A file is created in \\<computer_name>\Users\<user_name>\AppData\Roaming\ESRI\Desktop<release#>\ArcCatalog.

You can move the connection to another location; just be sure users and applications that need to make a connection have read access to the directory where you place the connection file.

If you use the data from this connection as the source for a service, such as a geoprocessing or geocoding service, you may need to place the connection file in a shared location on your network. See Make your data accessible to ArcGIS Server for more information about sharing a connection file.

(Geodatabase only) Connect to a specific geodatabase version

When you initially connect to a geodatabase in PostgreSQL, you connect to the Default version using the Database Connection dialog box. If you use geodatabase versioning and want to connect to a different transactional or historical version, change versions using the Geodatabase Connection Properties dialog box. For more information, see Connect to a specific geodatabase version.

Connect from ArcGIS Server

ArcGIS Server includes PostgreSQL client files; therefore, you do not need to download and copy PostgreSQL client files to connect.

As with connections from other clients, be sure to alter the PostgreSQL pg_hba.conf file and make sure the necessary login or group roles have CONNECT privileges in the database.

If you want the services you publish to ArcGIS Server to use the data in your database or a geodatabase in PostgreSQL, register the database with your ArcGIS Server sites. You can do this from ArcMap or ArcGIS Server Manager.

ArcGIS Desktop

  • Home
  • Documentation
  • Support

ArcGIS

  • ArcGIS Online
  • ArcGIS Desktop
  • ArcGIS Enterprise
  • ArcGIS
  • ArcGIS Developer
  • ArcGIS Solutions
  • ArcGIS Marketplace

About Esri

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