<div dir="ltr">Hi!<div><br></div><div>We have a PostGIS database with login roles and group roles (like "admins", "editors" and "viewers"). We have defined that only "admins" can create new schemas and tables (among other privileges). My problem is that I'd like to use ogr2ogr to bulk load some data to a PostGIS database using ogr2ogr with a certain login role with "admins" role.</div><div><br></div><div>It seems that it is not possible to define roles in PostgreSQL connection parameters (my first try) or in PostgreSQL driver options.</div><div> </div><div>I tried to use PREDUDE_STATEMENTS like: "-doo "PRELUDE_STATEMENTS=SET ROLE admins", but got warning "Warning 1: -doo ignored when creating the output datasource."</div><div><br></div><div>Any solutions or suggestions?</div><div><br>There is also similar case in QGIS: Supporting "set role" when connecting to a postgres database - <a href="https://github.com/qgis/QGIS/issues/42763">https://github.com/qgis/QGIS/issues/42763</a></div><div><br></div><div>Versions: GDAL 3.0.4, released 2020/01/28, PostgreSQL 12.7, PostGIS 3.1</div><div><br></div><div>Rgs,</div><div><br></div><div>Pekka</div><div><div><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div dir="ltr"><div dir="ltr"><p><span style="font-size:12.8000001907349px">Pekka Sarkola<br></span><span style="font-size:12.8000001907349px">Gispo Oy<br></span><a href="mailto:pekka.sarkola@gispo.fi" style="font-size:12.8000001907349px" target="_blank">pekka.sarkola@gispo.fi</a><span style="font-size:12.8000001907349px">   -
GSM +358 40 725 2042<br></span><a href="http://www.gispo.fi/" style="font-size:12.8000001907349px" target="_blank">www.gispo.fi</a><span style="font-size:12.8000001907349px"> – </span><a href="http://www.paikkatieto.com/" style="font-size:12.8000001907349px" target="_blank">www.paikkatieto.com</a></p></div></div></div></div></div></div></div></div></div>