I am trying to convert ESRI FileGDB to PostGIS
I created a new database: 'newkelibia' with pgAdmin 4
using OSGeo4W shell I executed this:
ogr2ogr, -f "PostgreSQL" PG:"host=localhost port=5432 user='postgres' password='1234' dbname='newkelibia'" C:\Users\ons\Documents\CityEngine\Default Workspace\new_project\models\KlibiaBD.gdb" -overwrite -progress --config PG_USE_COPY YES
and I got this error:
ERROR 1: PostgreSQL driver doesn't currently support database creation. Please create database with the `createdb' command. ERROR 1: PostgreSQL driver failed to create
Did I mess any steps ?
1 Answer 1
Running ogr2ogr so that the program name is followed by a comma "," gives rather similar error message for me on Windows.
ogr2ogr, -f "PostgreSQL" PG:"host=localhost port=5432 user='user' password='password' dbname='test'" -overwrite test.gpkg --config PG_USE_COPY YES
ERROR 1: PostgreSQL driver doesn't currently support database creation.
Please create database with the `createdb' command.
ERROR 1: PostgreSQL driver failed to create ,
Syntax ogr2ogr -f "PostgreSQL" ...
works fine.
I am not sure if this is some sort of bug. It seems that comma can follow the native Windows commands and then it means a separator between the command and the first parameter.
So this dir,/s,c:\temp
does the same job than dir /s c:\temp
.
See also https://stackoverflow.com/questions/47222968/what-does-the-comma-after-a-command-do. Anyway, commas do not work as parameter separators for gdal command line utilities. Use spaces.
-
thank you @user30184 I have no more error message or any message, what does this mean ?Rihab Bouallagui– Rihab Bouallagui2021年01月17日 16:56:18 +00:00Commented Jan 17, 2021 at 16:56
-
Hopefully success. Have a look at your database.user30184– user301842021年01月17日 16:57:58 +00:00Commented Jan 17, 2021 at 16:57
-
unfortunately , nothing has changed :(Rihab Bouallagui– Rihab Bouallagui2021年01月19日 21:31:14 +00:00Commented Jan 19, 2021 at 21:31
Explore related questions
See similar questions with these tags.
dbname='newkelibia'
ogrinfo PG:"host=localhost port=5432 user='postgres' password='1234' dbname='newkelibia'"
.PG:host=localhost port=5432 user='postgres' password='1234' dbname='newkelibia'' using driver
PostgreSQL' successful. AND I GOT THE SAME MSG