Registering a PostgreSQL database with the server
As a server administrator, you have the option to register your data folders, databases, and geodatabases with ArcGIS Server. Data registration gives the server a list of locations that the server administrator has verified that the GIS server can access. Data registration also helps the GIS server understand how to adjust data paths when publishing across machines.
The following sections describe how you can prepare your ArcGIS client to connect to a PostgreSQL database (whether the database contains a geodatabase or not) and register the database with ArcGIS Server.
Copying PostgreSQL client files
To connect directly from an ArcGIS client to a PostgreSQL database, you must place the PostgreSQL client libraries in the bin directory of the ArcGIS client. You can download the client libraries from the Esri Customer Care portal.
Be sure to use the correct libraries for the operating system and ArcGIS client. For example, to connect to PostgreSQL from ArcGIS Server on Linux, you must place the Linux 64-bit client libraries in the ArcGIS Server bin directory. To connect to PostgreSQL from ArcGIS for Desktop, you must place the Windows 32-bit client libraries in the Desktop bin directory.
If your ArcGIS Server site is composed of multiple server machines, you must place the 64-bit PostgreSQL client libraries on all servers in the site.
See Setting up a connection to PostgreSQL for more information on the PostgreSQL client libraries.
Granting privileges
The PostgreSQL login or group role that will be used to connect to the database must be granted privileges in the database to access the data to be published.
- The role must be able to connect to the database. By default, this is granted to the public group. If you revoke that privilege from the public group, you must grant it to specific login roles or groups.
- The role must be granted USAGE privileges on all schemas that contain data or other resources to be published. If you are using a geodatabase, the role must be granted USAGE on the sde schema.
- The role must be granted at least SELECT privileges on data to be published.
- If you will be publishing editable feature services, the role must be granted the required privileges—INSERT, UPDATE, and/or DELETE—on the data to be edited. You can grant SELECT, INSERT, UPDATE, and DELETE privileges from ArcGIS for Desktop. See Granting and revoking privileges on datasets for more information.
- If you will be registering the geodatabase as a managed database, the user with which you connect must have privileges sufficient to create data in the geodatabase and must own a schema that matches the database user name.
See User privileges for geodatabases in PostgreSQL for more information on privileges for different types of database users.
Connecting to PostgreSQL
To register a database with the server, you must provide connection information. There are two ways you can do this:
- Import an existing .sde file that contains the connection information.
You can create a Database Connection (.sde) file from the Catalog tree in ArcGIS for Desktop, using the Create Database Connection geoprocessing tool or a Python script.
- Provide your connection information at the time of registration.
No matter which way you choose, you must provide the following information to connect directly to PostgreSQL:
- The type of DBMS to which you are connecting (in this case, PostgreSQL)
- The name of the server on which PostgreSQL is installed
- Authentication Type set to database authentication
- A valid database login name and password, which must be saved with the connection
- The name of the database
For more information, see Database connections in ArcGIS for Desktop.
If you want to connect to a geodatabase in PostgreSQL using an ArcSDE service, you must create a .sde file using the Create ArcSDE Connection File geoprocessing tool or a Python script. Then import the connection when you register the geodatabase with ArcGIS Server.
Registering the database with ArcGIS Server
You can register the database from Server Manager or the Catalog tree in ArcGIS for Desktop. See the following topics for an explanation of registration options and how to register the database: