Creating a database and geodatabase in PostgreSQL
This topic applies to ArcGIS for Desktop Standard and ArcGIS for Desktop Advanced only.
You can use the Create Enterprise Geodatabase tool in ArcGIS for Desktop to do the following in a PostgreSQL database cluster:
- Create a database using the postgres template.
- Create an sde user and schema and grant the user superuser privileges, which are required to create a geodatabase and drop database connections.
- Grant the public group role usage on the sde schema.
- Create a geodatabase in the database.
At a minimum, you must install PostgreSQL and set it up to accept remote connections, place the ST_Geometry library on the PostgreSQL server, and install the PostgreSQL client on the ArcGIS for Desktop client machine before you run the Create Enterprise Geodatabase tool. See A quick tour of setting up a geodatabase in PostgreSQL for more information.
The following instructions explain how to create a geodatabase using the Create Enterprise Geodatabase tool. Alternatively, you could run a Python script or enable geodatabase functionality in a preconfigured PostgreSQL database.
- Start ArcMap or ArcCatalog.
- Open the Create Enterprise Geodatabase tool.
You can search for or browse to this tool, which is located in the Geodatabase Administration toolset of the Data Management toolbox.
- Choose PostgreSQL from the Database Platform drop-down list.
- Type the name of the PostgreSQL server in the Instance text box.
- In the Database text box, type the name of the database you want to create to contain your geodatabase.Note:
Type the database name in lower case; upper- and mixed-case object names are not supported for geodatabases in PostgreSQL.
- You must connect to the database cluster as the postgres superuser to create the database and other objects; therefore, the Database Administrator text box defaults to postgres. If your postgres superuser has a different name, type that name in the Database Administrator text box.
- Type the password for the postgres superuser in the Database Administrator Password text box.
- Type a password for the geodatabase administrator user (sde) in the Geodatabase Administrator Password text box.
If the sde user already exists in the database cluster, type the existing user's password and an sde schema is created in the database. If the user does not already exist, a user named sde with the password you specify is created in the database cluster and a corresponding schema is created in the database. Usage is granted on the sde schema to the public group role.
Tip:If you want to make the schema more secure after the geodatabase is created, you can revoke usage from the public group role, create a new group role, grant usage on the sde schema to that role, then grant the group role to all login roles that need to access the geodatabase.
- If you have a preconfigured tablespace you want to use as the default tablespace for the database, type its name in the Tablespace Name text box.
This tool does not create a tablespace; you must either specify an existing tablespace or leave this text box blank. If you do not specify a tablespace, the database is created in pg_default.
- To specify an Authorization File, browse to and choose the keycodes file that was created when you authorized ArcGIS for Server Enterprise.
This file is written to \\Program Files\ESRI\License<release#>\sysgen folder on Windows servers and /arcgis/server/framework/runtime/.wine/drive_c/Program Files/ESRI/License<release#>/sysgen on Linux. If you have not already done so, authorize ArcGIS for Server now to create this file.
- Click OK to run the tool.
A log file for the geodatabase creation (GDBCreateGeodatabase<#>.log) is written to the directory specified for your %TEMP% variable on the computer where the tool is run.