QGIS icon indicating copy to clipboard operation
QGIS copied to clipboard

PostgreSQL authentification get back to basic if a layer is opened with "execute SQL" from qgis explorer panel

Open thomas-szczurek opened this issue 5 months ago • 5 comments

What is the bug or the crash?

When you execute a query in the qgis explorer to open PostGIS data with right click -> execute SQL, the user's name appears in the data source instead of the authcfg string even if the connection toward Postgis was made with a authentification file. This makes qgz unsharable as on another user side, qgis with ask for the 1st user credentials to open the project.

Steps to reproduce the issue

  • Select a Postgis layer in qgis explorer and drag and drop it into the canveas.
  • Look at her datasource and see the 'authcfg' string
  • Now back in the qgis explorer right click on the same layer and click Execute SQL
  • Just remove LIMIT 10 to have :
SELECT * FROM schema.table
  • Load the query result into qgis
  • look at the datasource and see the username string instead of authcfg

Versions

3.34.8

Supported QGIS version

  • [X] I'm running a supported QGIS version according to the roadmap.

New profile

Additional context

No response

thomas-szczurek avatar Sep 18 '24 08:09 thomas-szczurek