qgis / QGIS

QGIS is a free, open source, cross platform (lin/win/mac) geographical information system (GIS)
https://qgis.org
GNU General Public License v2.0
10.48k stars 2.99k forks source link

postgres session role ignored by "Export to PostgreSQL" #58516

Open l-imb opened 1 month ago

l-imb commented 1 month ago

Hi folks,

first time here on QGIS-Github ;). I have encountered a problem with PostgreSQL connections and the PostgreSQL export tools.

Situation: "UserA" (no inheritance) has no privileges to create tables in the database but is part of "GroupA" with those privileges. Accordingly, the session ROLE of the connection is set to "GroupA" He now exports some vector data to the database.

Expected behavior: The newly created table is owned by "GroupA"

Actual behavior: The newly created table is owned by "UserA"

Problem with this: All the default privileges for tables etc. are bound to "Groups", because there are some groups but a multitude of users. With the actual behavior the admins have to set privileges to every newly created table manually.

Is this just a misunderstanding on my part or is this an actual bug/not implemented feature?

Best, Lennart

Steps to reproduce the issue

connect to database with session role set and export a layer.

Versions

QGIS 3.34.10 PostgreSQL 16.4

Supported QGIS version

New profile

Additional context

No response

m-kuhn commented 1 month ago

CC @rldhont