Skip to main content
2 of 7
added 42 characters in body
Encomium
  • 3.2k
  • 2
  • 15
  • 42

Use UNION or UNION ALL, depending on whether you want duplicates. Example:

SELECT f1,f2,f3
FROM t1

UNION 

SELECT f1,f2,f3
FROM t2

Assuming the structure is exact across all three tables, the geometry field is called geom and fields are ordered the same way:

CREATE TABLE master AS 
SELECT * FROM region_1
UNION
SELECT * FROM region_2
UNION
SELECT * FROM region_3;

ALTER TABLE master ADD COLUMN gid serial4 PRIMARY KEY;
CREATE INDEX master_idx on master using GIST(geom);

Creating your primary key field using serial4 rather than the default serial8 will avoid some issues ArcGIS has in reading PostgreSQL primary key fields.

Encomium
  • 3.2k
  • 2
  • 15
  • 42