1

I am new to GDAL and have been uploading CSV crime data to a postgis database using ogr2ogr.

ogr2ogr -f "PostgreSQL" -lco GEOMETRY_NAME=geometry -lco FID=gid PG:"host=server user=user dbname=dbname password=****" C:\Users\TommyH\Desktop\csv_upload_postgres.vrt -nln th_crime_2017 -t_srs EPSG:27700

I am now wondering if there is a way to transfer data from postgis to SQL or Oracle using GDAL ?

  • Yes, use either SQL Server or Oracle OCI as output format and read data from PostgreSQL. I would read first the GDAL document pages of the corresponding drivers. – user30184 Sep 17 '18 at 16:44
1

The GDAL ogr2ogr script I used to transfer data between databases is as followed.

ogr2ogr -overwrite -update -f "PostgreSQL" PG:"host=127.0.0.1 port=5432 dbname=databasename user=postgres password=*******" -f MSSQLSpatial "MSSQL:server=server;database=SUPPORT;UID=support;PWD=******" support.TEST -lco OVERWRITE=yes -lco SCHEMA=public  -a_srs EPSG:27700 -progress

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.