ArcGIS Desktop

  • Documentation
  • Support

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

Add the ST_Geometry type to a PostgreSQL database

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:

  1. 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.
  2. 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.

  3. Start ArcCatalog or ArcMap and open the Catalog window.
  4. Create a connection to your PostgreSQL database. Log in as the postgres user.
  5. 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.

  6. Add the database connection you created in step 4 to the Input database workspace text box.
  7. Type a password for the sde user in the SDE User Password text box.
  8. Leave the Tablespace Name text box blank.
  9. Click OK to run the tool.

The ST_Geometry type, subtypes, and functions are created in the schema of the sde user.

Related topics

  • ST_Geometry in PostgreSQL
  • Use a Python script to create the ST_Geometry type in PostgreSQL

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
  • Insiders Blog
  • User Conference
  • Developer Summit
Esri
Tell us what you think.
Copyright © 2018 Esri. | Privacy | Legal