Bug report #14436
Failure to connect to postgres database defined as service in DB manager
|Affected QGIS version:||2.14.0||Regression?:||No|
|Operating System:||Ubuntu||Easy fix?:||No|
|Pull Request or Patch supplied:||No||Resolution:|
|Crashes QGIS or corrupts data:||No||Copied to github as #:||22415|
I have set-up a new database connection in QGIS that uses service connection. I can connect successfully but when I try to connect to the same database it fails to connect. The error seems to be centred on DB manager not reading the service files correctly. It reads the user-name as database name and this causes it not to connect
[dbmanager] PG ignore env if service file is used
Funded by Boundless
#4 Updated by Admire Nyakudya almost 5 years ago
If I define a dbname it works. But I thought the point of using service files is to have the whole database configuration defined in the service file and then just connect. So this way does it mean the port,user name,password are the only parameters that are read from the service file when using DB Manager. When using service files with the Add postgis layers you can just specify service file and no other parameters and it still works.
#5 Updated by Luigi Pirelli almost 5 years ago
I don't think this is a but... but a feature request
when you add a db layer you connect to a specified db+table (otherwise default is tablename=username)... also just testing connection need a db... if not set it test on postgres db that is the administrative db always present.
if need db metadata... eg list of tables in a db, you have to connect to postgresdb and query relative tables.
if you need installed db on a remote db.
I feel that this have to be changed to feature request or removed as bug.
#7 Updated by Luigi Pirelli almost 5 years ago
I didn't know was a regression due to my lack of user experience
@Admire, just a question. your DB connection is set-up using basic authentication with user and pwd? or do you use any of the "new" authentication features storing credentials in auth-db? (settings->options->authentication).
The answer is useful to me to replicate the problem
#8 Updated by Admire Nyakudya almost 5 years ago
- File pg_service.conf added
I currently use basic authentication. I have uploaded a sample service file. [[http://www.postgresql.org/docs/9.1/static/libpq-pgservice.html]]