4

I have a QGIS project with many layers (inside multiple groups) with the same source (PostgreSQL).

When the project starts, for each of these layers to lead, it asks for the credentials which is the username and password of the database. Since all these layers use the same database, their credentials are identical and thus when the user enters the correct username/password for the first, it won't ask for it again and all the layers will be loaded.

But the problem is when the users does not have the correct username/password, the user clicks 'Cancel' on 'The Credential' windows hoping that it won't ask him again, but it asks again since there are multiple layers (100+). And the user can't even quit QGIS unless he clicks 'Cancel' 100+ times or kill QGIS from the Task Manager. Which is very annoying.

How can I fix this problem?

2
  • @C.-F.Vintar Unfortunately that is of no use. Maybe rereading the question clarify it.
    – Julk
    Jun 15, 2021 at 13:53
  • Why not using pg_service.conf to ease the pain?
    – ThomasG77
    Jun 15, 2021 at 15:30

1 Answer 1

3

I tested that on my project containing about 20 PostGIS-Layers. When asked for the credentials you can click on the small arrow next to the button "Ignore for 10 seconds" and set it to "Ignore for session" and than click on that. You will than be presented with a list of all the layers, that could not be loaded due to the missing authentication. You can than either choose to keep them nevertheless or throw them out (which you usually don't want to do). Works fine for me, does this help in your case?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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