0

I don't understand the problem when I use this command :

$ ogr2ogr -f "GPKG" "/.../..../.../.../.../gabarits gpkg/aep.gpkg" PG:"host='localhost' user='...' password='...' dbname='...' schemas='..._principale,..._commun,..._aep' LIST_ALL_TABLES=yes"
ERROR 1: PQconnectdb failed.
missing "=" after "LIST_ALL_" in connection info string

No syntax mistake, no problem if I retire LIST_ALL_TABLES=YES

1 Answer 1

0

The LIST_ALL_TABLES part does not belong to the PostgreSQL connection string. Remove that and use one of the two documented options, either the dataset open option or the configuration option https://gdal.org/drivers/vector/pg.html

$ ogr2ogr -f "GPKG" "/.../..../.../.../.../gabarits gpkg/aep.gpkg" PG:"host='localhost' user='...' password='...' dbname='...' schemas='..._principale,..._commun,..._aep'" -oo LIST_ALL_TABLES=yes

$ ogr2ogr -f "GPKG" "/.../..../.../.../.../gabarits gpkg/aep.gpkg" PG:"host='localhost' user='...' password='...' dbname='...' schemas='..._principale,..._commun,..._aep'" --config PG_LIST_ALL_TABLES YES
2
  • first line generate : Warning 1: -doo ignored when creating the output datasource. second works fine !
    – pasqal
    Commented Mar 25 at 19:20
  • Sorry, I did not test the commands and I was remembering that -doo stands for "dataset open option". Actually it means "destination open option" and thus it would affect the GeoPackage output, not the PG input. Use -oo LIST_ALL_TABLES=yes instead. I have edited the answer accordingly.
    – user30184
    Commented Mar 25 at 19:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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