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

Creating the database in PostgreSQL for the product library workspace

Available with Production Mapping license.

  • Creating the database
  • Creating schemas in the product library database
  • Moving indices to pm_sde_dict_index

You can choose to create the database using pgAdmin or psql.

Creating the database

Use one of the following script examples to create a database in PostgreSQL for the workspace.

  • Use the following script example to create the PRODLIB database using ST_Geometry.

    CREATE DATABASE prodlib WITH OWNER = postgres ENCODING = 'UTF8' 
    TABLESPACE=prodlib_sde_dict;
    
    ALTER DATABASE prodlib SET search_path="$user", public, sde;
    GRANT ALL ON DATABASE prodlib TO public;
    GRANT ALL ON DATABASE prodlib TO postgres;
    
  • Install PostGIS geometry.

    connect prodlib
    CREATE EXTENSION postgis;
    

Creating schemas in the product library database

  1. Use the following script example to create schemas in the PRODLIB database.

    \connect prodlib
    
    -- 'sde' schema.
    CREATE SCHEMA sde AUTHORIZATION sde;
    GRANT ALL ON SCHEMA sde TO sde;
    GRANT ALL ON SCHEMA sde TO public;
    
    --'prodlib' schema.
    CREATE SCHEMA prodlib authorization prodlib;
    GRANT USAGE ON SCHEMA prodlib to public;
    
    --'prodlibuser' schema.
    CREATE SCHEMA prodlibuser authorization prodlibuser;
    GRANT USAGE ON SCHEMA prodlibuser to public;
    GRANT SELECT, INSERT, UPDATE, DELETE ON ALL TABLES IN SCHEMA prodlib TO ckb_users;
    

  2. Run the following script example for each user that will create data using PostGIS geometry storage.

    GRANT SELECT, INSERT, UPDATE, DELETE ON public.geometry_columns to prodlib;
    GRANT SELECT ON public.spatial_ref_sys to prodlib;
    

For more information about creating a geodatabase, see Create an enterprise geodatabase.

Moving indices to pm_sde_dict_index

  1. Use the following script example to reorder the indices:

    select schemaname, tablename, indexname, tablespace
     from pg_indexes
       where schemaname = 'sde'
       order by schemaname, tablename, indexname, tablespace;
    

  2. Use the following script example to move the indices:

    select 'alter text'|| schemaname||'.'||indexname||'set tablespace pm_sde_dict_index;'
    as SQLTXT
    from pg_indexes
      where schemaname = 'sde'
      order by schemaname, tablename, indexname, tablespace;
    

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