<html><head><style>body{font-family:Helvetica,Arial;font-size:13px}</style></head><body><div style="font-family:Helvetica,Arial;font-size:13px; ">Hi,</div><div style="font-family:Helvetica,Arial;font-size:13px; "><br></div><div style="font-family:Helvetica,Arial;font-size:13px; ">I’ve been using ogr2ogr to import vector datasets into PostGIS tables.</div><div style="font-family:Helvetica,Arial;font-size:13px; "><br></div><div style="font-family:Helvetica,Arial;font-size:13px; ">I originally tried this using a local Postgres server, and ran the following commands to import one file into a PostGIS table, and then append the contents of another file to the same table:</div><div style="font-family:Helvetica,Arial;font-size:13px; "><br></div><div style="font-family:Helvetica,Arial;font-size:13px; ">ogr2ogr --debug ON -f PostgreSQL PG:”host=localhost user=postgres password=blah dbname=test_db" buildings1.gpkg -nln ogr_test</div><div style="font-family:Helvetica,Arial;font-size:13px; "><div style="margin: 0px;">ogr2ogr -append -update --debug ON -f PostgreSQL PG:”host=localhost user=postgres password=blah dbname=test_db" buildings2.gpkg -nln ogr_test</div><div class="bloop_container"><div class="bloop_frame"></div></div></div><div class="bloop_container"><div class="bloop_frame">  </div></div><br><div class="gmail_signature">This works fine, and both commands run quickly.</div><div class="gmail_signature"><br></div><div class="gmail_signature">I then tried the same thing, but with a PostGIS server hosted on Azure. Obviously I expect things to take longer when accessing across the internet, but this time the first command completed quickly, but the second command seems to hang. Looking at the debug output, it shows:</div><div class="gmail_signature"><br></div><div class="gmail_signature"><div class="gmail_signature">GPKG: GeoPackage v1.2.0</div><div class="gmail_signature">GDAL: GDALOpen(buildings2.gpkg, this=0x131011800) succeeds as GPKG.</div><div class="gmail_signature">PG: Client encoding: 'UTF8'</div><div class="gmail_signature">PG: PostGIS schema: 'public'</div><div class="gmail_signature">PG: PostgreSQL version string : 'PostgreSQL 15.4 on x86_64-pc-linux-gnu, compiled by gcc (Ubuntu 7.5.0-3ubuntu1~18.04) 7.5.0, 64-bit'</div><div class="gmail_signature">PG: PostGIS version string : '3.3 USE_GEOS=1 USE_PROJ=1 USE_STATS=1'</div><div class="gmail_signature">GDAL: GDALOpen(PG:<connection string>, this=0x140f25850) succeeds as PostgreSQL.</div><div class="gmail_signature">PG: Primary key name (FID): fid, type : int4</div><div class="gmail_signature">PG: Using column 'fid' as FID for table 'ogr_test'</div><div class="gmail_signature">OGR2OGR: Using WriteArrowBatch()</div><div class="gmail_signature"><br></div><div class="gmail_signature">and then nothing else.</div><div class="gmail_signature"><br></div><div class="gmail_signature">I’m intrigued as to why it seems to hang, and what it is doing, or trying to do. I’ve tried adding buildings2.gpkg to a new table on the Azure PostGIS server and it completes very quickly, so it’s not just that buildings2 is larger and takes a long time to upload. Similarly, merging the two buildings files with ogrmerge.py and then running the ogr2ogr command to import to PostGIS also works, and runs quickly.</div><div class="gmail_signature"><br></div><div class="gmail_signature">I’m also intrigued as to why this only seems to be happening with the Azure server - is there some configuration option I need to set? I’ve tried connecting as the ‘postgres’ root user, so it shouldn’t be a permissions issue.</div><div class="gmail_signature"><br></div><div class="gmail_signature">Any ideas or suggestions of things to try?</div><div class="gmail_signature"><br></div><div class="gmail_signature">Any help gratefully received,</div><div class="gmail_signature"><br></div><div class="gmail_signature"><div class="gmail_signature">Best regards,</div><div class="gmail_signature"><br></div><div class="gmail_signature">Robin</div></div></div></body></html>