File Geodatabase to PostGIS: A Reproducible ogr2ogr Migration

ogr2ogr loads a file geodatabase's features and attributes into PostGIS in one command, then drops its domains, subtypes, and relationship classes without flagging the loss.

Sheet
A-12
Date
Category
GIS
Read
12 min
Updated
Nov 19, 2026
Contents

ogr2ogr moves a file geodatabase’s features and attributes into PostGIS in one command, and it drops the geodatabase’s domains, subtypes, and relationship classes on the way. This guide runs the migration on a public USGS geodatabase, shows the output, rebuilds the missing schema in SQL, and proves the copy.

Every command below ran against real data, and every output number in this piece comes from that run. The piece names exactly which schema objects ogr2ogr drops, pulls their definitions back out of the geodatabase’s own catalog table, and rebuilds them in SQL. A reader with a .gdb and a PostGIS target can follow the same steps against their own data.

What carries over and what doesn’t

ogr2ogr loads geometry and attributes into PostgreSQL in one pass. The reconciliation queries later in this piece confirm that every row arrived. The load carried these objects into PostgreSQL without any extra SQL:

  • every row from each source table and feature class
  • NOT NULL constraints from the source columns
  • column defaults, including ftype 468 and fcode 46800 on nhdflowline
  • source OBJECTIDs, copied into an objectid column running from 1 to 15839 on the flowlines
  • Z and M coordinates, since nhdflowline lands as MULTILINESTRING with coordinate dimension 4
  • dates, stored as timestamp with time zone
  • a GiST spatial index on every geometry table

Three schema object types never reached the target database:

  • field domains, so integer and text values arrive with no lookup table attached
  • Esri subtypes, with no trace of the subtype field or its codes
  • relationship classes, including the ten that connect feature classes to metadata and citations

Nothing in the schema stopped a bad value from landing in a column that should have refused it. The loaded database held 15 primary keys and no CHECK or foreign key constraint anywhere. An UPDATE that set resolution to 99, a code outside the Resolution domain, succeeded without complaint.

The demo data and tools

The demo uses the USGS National Hydrography Dataset (NHD) file geodatabase for 4-digit hydrologic unit (HU4) 0104, published December 7, 2023, from the USGS NHD HU4 staging index. The zip file is 14,025,537 bytes and unzips to 29 MB.

USGS retired the NHD on October 1, 2023. Its access page says the data will stay available but won’t be maintained, with current work moving to the 3D Hydrography Program. Teams leaving ArcMap face the same load; the ArcMap retirement guide covers the wider move.

USGS-authored data is in the US public domain, so anyone can reuse this geodatabase. The USGS copyright and credit guidance asks users to credit the USGS when they publish work built on it.

The demo runs GDAL 3.13.3 from the official ghcr.io/osgeo/gdal:ubuntu-small-3.13.3 Docker image, so there’s no GDAL build and no ArcGIS Pro in the pipeline. The target is PostgreSQL 16.4 with PostGIS 3.4.3, a fresh database named demo_gdb, and a schema named nhd. Standing up and tuning that database is its own job. The geodatabase holds 22 non-spatial tables and 19 feature classes in 3 feature datasets. It also holds 62 field domains, 61 coded and 1 range. It has 10 relationship classes, 58 subtypes across 5 feature classes, and 1 geometric network. The whole scripted run, load plus rebuild plus audit, finished in 18 seconds.

Inspect the geodatabase first

Before any data moves, ogrinfo shows what the OpenFileGDB driver already sees inside the .gdb. Run against the whole .gdb, it lists the feature datasets, layers, and relationship classes.

$ ogrinfo -ro /data/NHD_H_0104_HU4_GDB.gdb
INFO: Open of `/data/NHD_H_0104_HU4_GDB.gdb'
      using driver `OpenFileGDB' successful.
...
Group Hydrography:
  Layer: NHDWaterbody (3D Multi Polygon)
  Layer: NHDPoint (3D Point)
  Layer: NHDLine (3D Multi Line String)
  Layer: NHDFlowline (3D Measured Multi Line String)
  Layer: NHDArea (3D Multi Polygon)
  ...
Relationship: NHDFlowlineToMeta (Association, NHDFlowline, NHDFeatureToMetadata)
Relationship: NHDMetaToFeature (Association, NHDMetadata, NHDFeatureToMetadata)
Relationship: NHDMetadataHasSourceCitation (Association, NHDMetadata, NHDSourceCitation)
...

The Hydrography feature dataset holds NHDWaterbody, NHDPoint, NHDLine, and NHDFlowline among others. The relationship list at the bottom names Association relationships such as NHDFlowlineToMeta, the type ogr2ogr won’t carry forward.

A single layer’s field list shows which columns carry a domain name. A -fielddomain call prints the coded values behind one of them.

$ ogrinfo -ro -so -nocount -noextent /data/NHD_H_0104_HU4_GDB.gdb NHDWaterbody
resolution: Integer (0.0) NOT NULL, domain name=Resolution
elevation: Real (0.0), domain name=ElevationRange
ftype: Integer (0.0) NOT NULL DEFAULT 390
fcode: Integer (0.0) DEFAULT 39004
visibilityfilter: Integer (0.0) NOT NULL DEFAULT 0, domain name=VisibilityFilter Domain
$ ogrinfo -ro /data/NHD_H_0104_HU4_GDB.gdb -fielddomain "LakePond FCode"
Domain LakePond FCode:
  Type: coded
  Field type: Integer
  Coded values:
    39000: Lake/Pond
    39001: Lake/Pond: Hydrographic Category = Intermittent
    39004: Lake/Pond: Hydrographic Category = Perennial
    ...

NHDWaterbody’s resolution and elevation fields each name a domain. fcode defaults to 39004, and the LakePond FCode domain alone defines 9 values. Printing every domain at once needs ogrinfo’s -json switch, added in GDAL 3.7, per the ogrinfo documentation. GDAL 3.13.3 has no -listfielddomains switch; the demo’s attempt at that flag failed with an Unknown argument error.

Subtypes don’t show up there at all. The only way to see them is to pull a layer’s full definition as XML with a GetLayerDefinition query and grep the subtype tags out of it.

$ ogrinfo -ro /data/NHD_H_0104_HU4_GDB.gdb -sql "GetLayerDefinition NHDWaterbody" \
    | grep -oE '<(SubtypeFieldName|DefaultSubtypeCode|SubtypeName|SubtypeCode)>[^<]*' | sed 's/^<//; s/>/: /'
SubtypeFieldName: ftype
DefaultSubtypeCode: 390
SubtypeName: Reservoir
SubtypeCode: 436
SubtypeName: SwampMarsh
SubtypeCode: 466
...
SubtypeName: LakePond
SubtypeCode: 390

NHDWaterbody carries its subtypes on the ftype field, with LakePond as the default subtype at code 390. Five other subtypes sit alongside it, including Reservoir at 436 and SwampMarsh at 466, each binding fcode to its own domain underneath.

The driver capability flags below show why none of this survives the move to PostgreSQL.

$ ogrinfo --format OpenFileGDB | grep -E 'field domain|RELATIONSHIP'
  Supports: Reading field domains.
  Creation field domain types: Coded Range
    GDAL_DMD_RELATIONSHIP_FLAGS=OneToOne OneToMany ManyToMany Composite Association ForwardPathLabel BackwardPathLabel
$ ogrinfo --format PostgreSQL | grep -E 'Supports|domain|RELATIONSHIP'
  Supports: Vector
  Supports: Open() - Open existing dataset.
  Supports: Create() - Create writable dataset.
  Supports: Update
  Supports: Creating fields with NOT NULL constraint.
  Supports: Creating fields with UNIQUE constraint.
  Supports: Creating fields with DEFAULT values.
  Supports: Creating geometry fields with NOT NULL constraint.
  Supports: Curve geometries.
  Supports: 3D (Z) geometries.
  Supports: Measured (M) geometries.
  Supports: Multiple vector layers.

The OpenFileGDB driver page confirms that output. The driver has read coded and range field domains since GDAL 3.3 and relationships since GDAL 3.6, and it can’t read data compressed as SDC or CDF. The PostgreSQL driver’s own capability list reports no field domain or relationship support. GDAL’s driver pages say nothing about Esri subtypes. The layer-definition XML is the only route to them.

Load it with ogr2ogr

Four ogr2ogr calls move the whole geodatabase into PostgreSQL, one for the line and polygon layers, one for the points, one for the plain tables, and one for the catalog.

PG='PG:host=localhost dbname=demo_gdb user=gis'
GDB=/data/NHD_H_0104_HU4_GDB.gdb

# lines and polygons
ogr2ogr -f PostgreSQL "$PG" $GDB NHDFlowline NHDLine NHDArea NHDWaterbody NHDAreaEventFC NHDLineEventFC WBDHU12 \
  -lco SCHEMA=nhd -lco GEOMETRY_NAME=geom -lco FID=objectid \
  -nlt PROMOTE_TO_MULTI -nlt CONVERT_TO_LINEAR -t_srs EPSG:5070 \
  --config PG_USE_COPY YES

# points stay points
ogr2ogr -f PostgreSQL "$PG" $GDB NHDPoint NHDPointEventFC \
  -lco SCHEMA=nhd -lco GEOMETRY_NAME=geom -lco FID=objectid -t_srs EPSG:5070 --config PG_USE_COPY YES

# related tables
ogr2ogr -f PostgreSQL "$PG" $GDB NHDFeatureToMetadata NHDMetadata NHDSourceCitation NHDFCode \
  -lco SCHEMA=nhd -lco FID=objectid --config PG_USE_COPY YES

# the geodatabase catalog: domain, subtype and relationship definitions as XML
ogr2ogr -f PostgreSQL "$PG" $GDB -oo LIST_ALL_TABLES=YES \
  -sql "SELECT i.Name AS item_name, t.Name AS item_type, i.Definition AS definition FROM GDB_Items i JOIN GDB_ItemTypes t ON i.Type = t.UUID" \
  -nln gdb_items -nlt NONE -lco SCHEMA=nhd -lco FID=item_id

-lco SCHEMA=nhd sends every table into the same schema. -lco GEOMETRY_NAME=geom replaces the driver’s default wkb_geometry column name.

-lco FID=objectid makes the feature’s own OBJECTID the primary key. Without it, the PostgreSQL driver page says ogr2ogr creates a new column named ogc_fid instead. The ogr2ogr documentation notes that ogr2ogr preserves source FIDs by default whenever the target driver offers a FID creation option, which PostgreSQL does. The driver page also warns that combining -overwrite with -lco SCHEMA will not work, and recommends -nln or the active_schema connection string instead. None of these four calls uses -overwrite, but it’s worth knowing before one does.

-nlt PROMOTE_TO_MULTI and -nlt CONVERT_TO_LINEAR run together on the first call. The ogr2ogr documentation says that combination has worked since GDAL 3.0.5. The first flag keeps every polygon and line as a MULTI type. The second flattens any circular arc into straight segments before PostGIS sees it.

-t_srs EPSG:5070 reprojects every geometry on the way in. EPSG:5070 is NAD83 / Conus Albers, an equal-area projection measured in meters across the lower 48 states. Every length and area figure later in this piece comes out in meters.

--config PG_USE_COPY YES matters most on an -append run. The PostgreSQL driver page says ogr2ogr already uses COPY by default when it creates a table fresh. The driver falls back to row-by-row INSERT when a column carries a DEFAULT that a feature leaves unset. The fourth call also adds -oo LIST_ALL_TABLES=YES, the GDAL 3.4+ option that exposes GDB_Items and the geodatabase’s other system tables. Its SQL joins GDB_Items to GDB_ItemTypes and pulls every domain, subtype, and relationship definition out as XML.

All four calls returned exit code 0. The first, loading the seven line and polygon layers, took 2,672 ms. It printed one warning, that organizePolygons() received a polygon with more than 100 parts.

What landed in PostGIS

A geometry-columns query against the new schema shows nine geometry tables, all reprojected to EPSG:5070.

   table_name    |      type       | coord_dimension | srid
-----------------+-----------------+-----------------+------
 nhdarea         | MULTIPOLYGON    |               3 | 5070
 nhdflowline     | MULTILINESTRING |               4 | 5070
 nhdpoint        | POINT           |               3 | 5070
 nhdwaterbody    | MULTIPOLYGON    |               3 | 5070
 wbdhu12         | MULTIPOLYGON    |               2 | 5070
 ...
 contype | constraints
---------+-------------
 p       |          15

UPDATE nhd.nhdwaterbody SET resolution = 99 WHERE objectid = 1;
UPDATE 1

nhdflowline came in as MULTILINESTRING with coordinate dimension 4. It kept Z and M. Z stays at 0 throughout this dataset. M runs from 0.053875 to 99.904125 along the flowlines, so the vertical dimension goes unused here while the measure dimension doesn’t.

The schema’s primary keys total 15, and there isn’t a CHECK or foreign key constraint anywhere yet. SHAPE_Length arrived as an ordinary numeric column, still in the source geodatabase’s degrees rather than meters. On objectid 1, SHAPE_Length reads 0.027142. ST_Length against the reprojected geometry gives 2,691.8 meters, and the NHD’s own lengthkm attribute agrees at 2.69176641.

Dates came across as timestamp with time zone, and column defaults survived the trip too; ftype defaults to 468 and fcode to 46800 on nhdflowline, and a GiST index sits on every geometry column already.

Rebuild domains and subtypes from GDB_Items

The fourth ogr2ogr call already pulled GDB_Items into PostgreSQL as XML text. PostgreSQL’s xpath() function turns that XML back into rows. Two queries do the work, one for coded domain values and one for subtype-to-domain bindings.

CREATE TABLE nhd.domain_code AS
SELECT d.item_name                            AS domain_name,
       (xpath('/*/Code/text()', cv))[1]::text AS code,
       (xpath('/*/Name/text()', cv))[1]::text AS label
FROM nhd.gdb_items d,
     unnest(xpath('/*/CodedValues/CodedValue', d.definition::xml)) AS cv
WHERE d.item_type = 'Coded Value Domain';

CREATE TABLE nhd.subtype_field_domain AS
SELECT lower(c.item_name)                                  AS table_name,
       (xpath('/*/SubtypeCode/text()', s))[1]::text::int   AS subtype_code,
       lower((xpath('/*/FieldName/text()', fi))[1]::text)  AS column_name,
       (xpath('/*/DomainName/text()', fi))[1]::text        AS domain_name
FROM nhd.gdb_items c,
     unnest(xpath('/*/Subtypes/Subtype', c.definition::xml)) AS s,
     unnest(xpath('/*/FieldInfos/SubtypeFieldInfo[DomainName]', s)) AS fi
WHERE c.item_type = 'Feature Class';

Reading GDB_Items this way, rather than through an ArcGIS Pro export tool, pulled out 243 coded values, 38 class-level domain bindings, and 218 subtype-level bindings. The same table held 10 relationship class definitions, covered in the next section. Two domains, Area Event Type and Line Event Type, define no coded values at all. The rebuild skips them rather than generating an empty CHECK constraint.

A generated ALTER TABLE statement turns each class-level domain into a CHECK constraint. A composite foreign key enforces the subtype-dependent fcode rules a plain CHECK can’t express.

-- generated for every class-level coded domain; NOT VALID only when rows already break it
ALTER TABLE nhd.nhdwaterbody ADD CONSTRAINT nhdwaterbody_resolution_dom
  CHECK (resolution::text IN ('1', '2', '3'));

-- subtype-dependent domain: allowed (ftype, fcode) pairs plus a composite foreign key
CREATE TABLE nhd.nhdwaterbody_subtype_fcode AS
SELECT sfd.subtype_code AS ftype, dc.code::int AS fcode, dc.label AS fcode_label
FROM nhd.subtype_field_domain sfd JOIN nhd.domain_code dc USING (domain_name)
WHERE sfd.table_name = 'nhdwaterbody' AND sfd.column_name = 'fcode';
ALTER TABLE nhd.nhdwaterbody_subtype_fcode ADD PRIMARY KEY (ftype, fcode);
ALTER TABLE nhd.nhdwaterbody ADD CONSTRAINT nhdwaterbody_fcode_by_subtype_fk
  FOREIGN KEY (ftype, fcode) REFERENCES nhd.nhdwaterbody_subtype_fcode;

NOTICE:  rejected: new row for relation "nhdwaterbody" violates check constraint "nhdwaterbody_resolution_dom"
NOTICE:  rejected: insert or update on table "nhdwaterbody" violates foreign key constraint "nhdwaterbody_fcode_by_subtype_fk"

The audit that follows checks 35 field-and-domain pairs against the live data. Every coded, range, and subtype rule comes back with 0 rows breaking it. GDAL offers no such guarantee on its own. Its vector data model documentation says GDAL doesn’t validate values against a field’s domain. The CHECK constraints close that gap in PostgreSQL.

Once the constraints are live, the two rejected updates above prove their worth. Setting resolution to 99 fails against nhdwaterbody_resolution_dom. Setting ftype to 436 (Reservoir) with fcode 39004, a LakePond code, fails against nhdwaterbody_fcode_by_subtype_fk. The subtype labels resolve to something readable too. 3,315 waterbodies are the LakePond subtype with the perennial Lake/Pond fcode 39004, and 469 are SwampMarsh with the plain Swamp/Marsh fcode.

A team that only needs resolved labels, not enforcement, can skip the SQL rebuild. ogr2ogr’s -resolveDomains flag, added in GDAL 3.3, adds a {field}_resolved column. That column holds each coded value’s description.

Rebuild relationship classes as foreign keys

Relationship classes don’t map onto foreign keys one for one. Eight of the ten share one destination column, nhdfeaturetometadata.permanent_identifier, each coming from a different feature class. A ninth, NHDMetaToFeature, reaches the same table on meta_processid, and the tenth links nhdmetadata to nhdsourcecitation.

A single foreign key column can’t reference eight parent tables at once. The fix is a registry table. It unions every feature id from all eight sources, and the foreign key points at it. Building it takes three statements, a UNION ALL across the eight source tables, a primary key on the combined id, and the foreign key itself.

CREATE TABLE nhd.feature_registry AS
SELECT permanent_identifier, 'nhdflowline'::text AS source_table FROM nhd.nhdflowline
UNION ALL SELECT permanent_identifier, 'nhdwaterbody' FROM nhd.nhdwaterbody
-- ... one line per origin feature class, 8 in all
;
ALTER TABLE nhd.feature_registry ADD PRIMARY KEY (permanent_identifier);
ALTER TABLE nhd.nhdfeaturetometadata ADD CONSTRAINT nhdfeaturetometadata_feature_fk
  FOREIGN KEY (permanent_identifier) REFERENCES nhd.feature_registry (permanent_identifier);

 bridge_rows_without_metadata | distinct_missing_ids
------------------------------+----------------------
                           92 |                    1

feature_registry ends up with 19,993 rows, one per distinct feature id across the eight source classes. The foreign key from nhdfeaturetometadata finds 0 orphans against it. nhdmetadata has 93 rows and 93 distinct meta_processid values, so that column gets a UNIQUE constraint. The 91 nhdsourcecitation rows validate against it with 0 unmatched. But 92 bridge rows in nhdfeaturetometadata point at a single meta_processid that nhdmetadata doesn’t have, so that one foreign key goes in as NOT VALID.

PostgreSQL’s ALTER TABLE documentation explains what NOT VALID does. It skips the scan of existing rows. New inserts and updates still have to pass. VALIDATE CONSTRAINT checks the old rows later, once the missing record is fixed. Finding and fixing that one orphaned meta_processid is work for a GIS data cleanup pass.

Check geometry validity

A validity check across every geometry table in the schema runs next, before anything downstream trusts the data. All nine geometry tables came back with 0 invalid geometries, so the repair step that follows had nothing to fix.

The repair pattern stays worth keeping even when it touches 0 rows. ST_MakeValid aims to keep every input vertex. It can still turn a polygon into a geometry collection. ST_CollectionExtract and ST_Multi force the result back to MULTIPOLYGON. A downstream query expecting that type won’t break.

With 0 invalid rows in this load, the wrapper never had to run, but a geodatabase that didn’t come in this clean would need it.

Reconcile the copy

A row-count reconciliation closes the loop. It compares every loaded layer’s row count in PostgreSQL against the count ogrinfo reported on the source geodatabase.

SELECT s.layer, s.source_rows, t.target_rows, t.target_rows - s.source_rows AS diff
FROM nhd.source_count s
CROSS JOIN LATERAL (
  SELECT (xpath('/row/c/text()',
          query_to_xml(format('SELECT count(*) AS c FROM nhd.%I', s.layer), false, true, '')))[1]::text::bigint AS target_rows
) t
ORDER BY s.layer;

        layer         | source_rows | target_rows | diff
----------------------+-------------+-------------+------
 nhdarea              |         113 |         113 |    0
 nhdfeaturetometadata |      100376 |      100376 |    0
 nhdflowline          |       15839 |       15839 |    0
 nhdwaterbody         |        3813 |        3813 |    0
 wbdhu12              |           90 |          90 |    0
 ... (13 rows, every diff 0)

All 13 loaded layers match their source featureCount exactly. Area and length totals line up almost as tightly. nhdwaterbody’s areasqkm column totals 401.36 square kilometers. ST_Area in EPSG:5070 gives 401.42, a difference of 0.015%. nhdflowline’s lengthkm column totals 9,771.07 against 9,771.08 kilometers from ST_Length.

nhdflowline, nhdwaterbody, and nhdarea each returned 0 geometries that came back null or empty. The schema started with 15 primary keys and nothing else. It ends with 23 CHECK constraints, 13 foreign keys (1 NOT VALID), 28 primary keys, and 1 UNIQUE constraint. For what to build on the loaded data next, see PostGIS for network infrastructure.

Running this on your own geodatabase

Seven checks carry over to any file geodatabase headed for PostGIS:

  • confirm none of the feature classes store their geometry compressed as SDC or CDF, since the OpenFileGDB driver can’t read either format
  • run a SELECT DISTINCT OGR_GEOMETRY check on the source layers before assuming -nlt CONVERT_TO_LINEAR is unnecessary, since this geodatabase returned only MULTILINESTRING and MULTIPOLYGON but another one might hold curves
  • avoid -skipfailures unless every skipped row gets logged and reviewed, since the flag hides failed rows rather than fixing them
  • plan separately for any geometric network the geodatabase defines; this demo’s load left out the geodatabase’s one geometric network, and geometric networks and other things a lift-and-shift loses covers why they don’t survive the move
  • treat SHAPE_Length and SHAPE_Area columns as suspect until checked against ST_Length or ST_Area in a projected SRID, since they can arrive in the source’s original units
  • skip any field domain that defines zero coded values, the way this rebuild skipped Area Event Type and Line Event Type, rather than generating an empty constraint
  • watch for relationship classes that share a destination table, the way eight of this geodatabase’s ten share nhdfeaturetometadata.permanent_identifier, since that pattern needs a registry table, not a plain foreign key

Moving editing off ArcGIS and onto QGIS once the data lands in PostGIS is its own project; see ArcGIS to QGIS migration for that move.

LayerSpec places GIS analysts and data migration specialists on your project, as a complete team or embedded in your own.

Start a project

Frequently asked questions

Does ogr2ogr copy file geodatabase domains into PostGIS?

No. The PostgreSQL driver has no concept of field domains. ogrinfo --format PostgreSQL lists no support for them. Values ogr2ogr loads keep their original type, plain integer or text, with no lookup table or constraint attached. The -resolveDomains flag adds a description column. It doesn’t enforce anything. Enforcing a domain in PostGIS means writing CHECK constraints yourself, built from the domain definitions GDB_Items still holds.

Can PostGIS store Esri subtypes?

Not as a native object. PostgreSQL has no subtype construct to receive them. GDAL’s driver pages don’t cover Esri subtypes. They use the word subtype only for a field subtype, like a Boolean stored as an integer. A subtype binds one field’s value, like ftype, to a second field’s allowed domain, like fcode. A CHECK constraint or a composite foreign key against a lookup table, built from the subtype bindings inside GDB_Items, reproduces that rule in PostgreSQL.

How do I keep relationship classes when moving a .gdb to PostGIS?

ogr2ogr doesn’t move them, even though the OpenFileGDB driver can read them starting in GDAL 3.6. The fix is to pull each relationship’s definition out of GDB_Items with xpath() and rebuild it as a PostgreSQL foreign key. When several relationship classes share one destination table, as eight of ten did in this migration, build a registry table first. Union the source ids into it, then foreign-key the destination to that registry instead of to any single source table.

Do I need ArcGIS to read a file geodatabase?

No. GDAL’s OpenFileGDB driver reads a file geodatabase’s features, attributes, field domains, and relationship classes with no Esri software installed. This entire demo ran from a GDAL Docker image with no ArcGIS Pro anywhere in the pipeline. It can’t read data compressed as SDC or CDF, a limit worth checking before assuming any geodatabase will open.

How do I check that every row made it into PostGIS?

Compare row counts layer by layer between the source and the target, the way this migration’s reconciliation query did. Expect a diff of 0 on every layer. Follow that with an area or length check against ST_Area or ST_Length in a projected SRID, since those catch unit mismatches a row count alone would miss. Check for null or empty geometries too; this load reported 0 of those in the three geometry tables checked.

Informational content, not engineering advice. Test every command on a copy of your data first.

Geospatial capacity

LayerSpec places GIS developers, analysts, and spatial database specialists on your project, as a complete team or embedded in your own.