[gdal-dev] gdal 3.11 python API and PostgreSQL driver

Even Rouault even.rouault at spatialys.com
Sat Aug 23 02:35:51 PDT 2025


Thomas,
>
> gdal vector convert test_file.csv PG:"dbname='insee' port=5432 
> host='localhost' user='thomas' password='xxxxxxxx' schemas='wip'"
>
> don't work, I need to add the --append option, even to create the 
> table from scratch (but is that the intended way ?)
>
--update would also work here (the error message has been updated in the 
3.12dev version to tell 'convert: Dataset 'PG:dbname=xxxxx' already 
exists. You may specify the --overwrite-layer/--append/--update option'
>
> Another problem was that with the Python API, with the :
>
> format=PostgreSQL option
>
> it won't be enough, I still need to specify PG: before my connection 
> string or gdal will search for a file or directory named as the 
> connection string.
>
Yes the PG: prefix must always be used for PostgreSQL connection strings


-- 
http://www.spatialys.com
My software is free, but my time generally not.



More information about the gdal-dev mailing list