How to add multiple same geometry shapefile (such as polygons) into a single table in PostGIS?

For example:
test_1 is a shapefile (polygon)
test_2 is a shapefile (polygon)
test_3 is a shapefile (polygon)

All of them should transfer into a test table.


  • 1
    Do they have exactly the same set of columns?
    – Bera
    Commented Mar 28, 2023 at 10:08
  • not all the columns are the same. But yes, main columns like id, name, etc, etc are the same.
    – Hasan
    Commented Mar 28, 2023 at 10:09
  • I would try ogr2ogr with append flag. But I havent tried it with different columns
    – Bera
    Commented Mar 28, 2023 at 10:11
  • The thing is, I have tried it but it gave the error of the same data type or also data is already there. How did you do with Ogr2ogr? could you please explain that?
    – Hasan
    Commented Mar 28, 2023 at 10:22


Browse other questions tagged or ask your own question.