I wanted to set up a generic QGIS project (with PostGIS data on localhost) that can be re-used by different users. I use trust authentication, so no need to worry about passwords.

The problem is that I still have to provide a user name when creating a local PostGIS connection in QGIS, which is stored in the QGIS project (.qgs) file. (I use the current login-user in Linux). The project file becomes unusable/invalid when a different user tries to use my project file on their machines.

Is there a way to set up the project (or system) so that it works for any Linux user name, assuming those users have default PostgreSQL databases/usernames, which are the same name as their OS user names?

Related: Creating new PostGIS connection in QGIS?

(I'm using QGIS3, PostGIS 2.4).

1 Answer 1


From tests with QGIS 3, QGIS allows creating a PostGIS connection to localhost without database and user names. Just leave them empty. And QGIS will use the default values such as the Linux login user name (or the environmental variables: PGUSER and PGDATABASE).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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