Hi,

I’m using ogr2ogr to load a GeoPackage file into a PostGIS database. I 
initially tried using a command like this:

ogr2ogr --debug ON -f PostgreSQL PG:"host=<IP> user=<user> password=robin$42 
dbname=data sslmode=require" file.gpkg -nln table_name

However, this doesn’t work, and I always get an error:

FATAL:  password authentication failed for user “<user>"

If I restructure the command to use the alternative postgresql:// connection 
string like this, then it works:

ogr2ogr --debug ON -f PostgreSQL 
'postgresql://<user>:robin$42@<IP>/data?sslmode=require’ file.gpkg -nln 
table_name

I don’t remember running into this problem before when connecting to PostGIS 
databases using the PG: connection string, so I’m wondering whether my shell is 
doing something strange with my password? Obviously I don’t want to share my 
actual password, but it has a $ in it, and I wonder whether somehow this is 
causing problems - but only when using the PG: connection string.

Any suggestions welcome,

Best regards,

Robin


Dr Robin Wilson
www.rtwilson.com

_______________________________________________
gdal-dev mailing list
gdal-dev@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/gdal-dev

Reply via email to