PostgreSQL data types supported in ArcGIS

When you create a table or add a column to a table in the database, columns are created as a specific data type. Data types are classifications that identify possible values for and operations that can be done on the data, as well as the way the data in that column is stored in the database.

When you access database tables from ArcGIS, you can work with specific data types. When accessing the database table through the Database Connections node in the Catalog tree or through a query layer in ArcMap, ArcGIS filters out any unsupported data types. If you access your database table directly, unsupported data types won't be displayed in the ArcGIS interface and you cannot edit them through ArcGIS. Similarly, when you copy tables containing unsupported data types with ArcGIS, it will only copy the supported data types; when you paste the table to another database or a geodatabase, the unsupported data type columns will not be present.

When you create a feature class or table in ArcGIS or add a column to an existing table or feature class using ArcGIS, there are 11 possible data types you can assign to a field. Database data types that don't correspond to these types cannot be used directly in ArcGIS client applications.

The first column lists the data types available in ArcGIS. The second column lists the PostgreSQL data type that will be created in the database. The third column shows what other PostgreSQL data types (if any) map to the ArcGIS data type when viewed in ArcGIS.

ArcGIS data types

PostgreSQL data types created

Other PostgreSQL data types that can be viewed

Notes

BLOB

BYTEA

DATE

TIMESTAMP WITHOUT ZONE

TIMESTAMP

DOUBLE

NUMERIC(p)

BIG SERIAL, DOUBLE PRECISION

The precision and scale specified in ArcGIS can affect the resultant data type created in the database. See ArcGIS field data types for more information.

FLOAT

NUMERIC(p)

The precision and scale specified in ArcGIS can affect the resultant data type created in the database. See ArcGIS field data types for more information.

GEOMETRY

ST_GEOMETRY or GEOMETRY

In an enterprise geodatabase, the GEOEMTRY_STORAGE setting of the configuration keyword used when creating the feature class determines which data type is created in the database.

ST_Geometry and geometry are superclasses. When creating feature classes in ArcGIS for Desktop, point feature classes created as ST_Geometry use the ST_Point subtype and point feature classes created as PostGIS geometry use the Point subtype for storage. For all other types of feature classes created in ArcGIS for Desktop, the superclass is used. If you create spatial columns using SQL, the actual data subtype created depends on what type of subtype you specify.

To use ST_Geometry in a database, you must install it. See Adding the ST_Geometry type to a PostgreSQL database for information.

To use the PostGIS geometry type, you must install PostGIS in your PostgreSQL database cluster, and the database itself must be enabled to use PostGIS. See your PostgreSQL documentation for more information.

GUID

VARCHAR(38)

LONG INTEGER

INTEGER

SERIAL

OBJECTID

INTEGER in a geodatabase

SERIAL in a database

The ArcGIS type ObjectID is the registered row ID column for the table (or feature class). Only one may exist per table. For tables created outside ArcGIS, columns are interpreted as ObjectID only after being registered with the geodatabase.

RASTER

BYTEA or ST_RASTER

Rasters are supported only in enterprise geodatabases, and which PostgreSQL data type is created depends on the DBTUNE configuration keyword used when creating the raster catalog, raster dataset, or mosaic dataset.

You must separately configure ST_Raster in the geodatabase if you want to use it. See Installing the ST_Raster type in PostgreSQL for instructions.

SHORT INTEGER

SMALLINT

REAL

TEXT

CHARACTER VARYING

CHARACTER, VARCHAR, TEXT

PostgreSQL data types supported in ArcGIS

If your table contains a column with a data type not supported in ArcGIS, you can cast the column to text. However, only do this if you just want to see the values in the column; do not do this if you need to perform any analysis that uses the values in that column. For example, you could execute a SELECT statement to choose the columns in tableb and cast the decimal column "total" to text:

SELECT id, name, total::text
FROM me.mydb.tableb;
8/21/2013