Available with Standard or Advanced license.
You can add the ST_Geometry type, subtype, and functions to your PostgreSQL database using the Create Spatial Type geoprocessing tool or a Python script.
The Create Spatial Type tool does the following:
- Creates an sde login role in the PostgreSQL database cluster
- Grants the sde user superuser privileges (these can be revoked after the ST_Geometry type is created)
- Creates a schema named sde in the database where you install the ST_Geometry type
- Grants the sde user full authority on the sde schema
- Grants USAGE privileges on the sde schema to the public login group (If you want, you can revoke this privilege, but you must grant USAGE on the sde schema to all users who need access to the ST_Geometry type, subtypes, or functions.)
- Creates the necessary functions, domains, tables (sde_coordinate_systems and sde_geometry_columns), and views (st_geometry_columns and st_spatial_references) in the sde schema, and the sde_spatial_references table in the public schema
Before running the tool, you must copy the st_geometry library to the PostgreSQL server.
The following steps explain how to install the ST_Geometry type in a PostgreSQL database:
- Copy the st_geometry library from the DatabaseSupport directory in the ArcGIS client installation location and place it in the PostgreSQL lib directory. Be sure you copy the correct st_geometry library for the version of PostgreSQL and operating system you will be using.
- The location of the lib directory on Linux can vary depending on how you installed PostgreSQL. To determine the correct location for your PostgreSQL installation, execute pg_config as the postgres user. The value that is returned for PKGLIBDIR is the lib directory where you need to place the st_geometry library. Log in as the root user to copy the file to the lib location.
- If PostgreSQL is installed on a Windows server, place the st_geometry.dll file in the %PostgreSQL%\lib directory.
- If you have PostgreSQL installed on a Windows server, you must have the Microsoft Visual C++ 2008 SP1 Redistributable Package (x64) installed on the server. If it is not present on the PostgreSQL server, download it from the Microsoft site and install it.
This is required to use the ST_Geometry type.
- Start ArcCatalog or ArcMap and open the Catalog window.
- Create a connection to your PostgreSQL database. Log in as the postgres user.
- Open the Create Spatial Type tool.
You can use the Search window to search for the tool or open the tool from the Workspace toolset of the Data Management toolbox.
- Add the database connection you created in step 4 to the Input database workspace text box.
- Type a password for the sde user in the SDE User Password text box.
- Leave the Tablespace Name text box blank.
- Click OK to run the tool.
The ST_Geometry type, subtypes, and functions are created in the schema of the sde user.