Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failure to connect to postgres database defined as service in DB manager #22415

Closed
qgib opened this issue Mar 7, 2016 · 18 comments
Closed

Failure to connect to postgres database defined as service in DB manager #22415

qgib opened this issue Mar 7, 2016 · 18 comments
Labels
Bug Either a bug report, or a bug fix. Let's hope for the latter! DB Manager Relating to the DB Manager core plugin
Milestone

Comments

@qgib
Copy link
Contributor

qgib commented Mar 7, 2016

Author Name: Admire Nyakudya (@NyakudyaA)
Original Redmine Issue: 14436
Affected QGIS version: 2.14.0
Redmine category:db_manager
Assignee: Alessandro Pasotti


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



Related issue(s): #22210 (duplicates), #24525 (relates), #24526 (relates)
Redmine related issue(s): 14208, 16625, 16626


@qgib
Copy link
Contributor Author

qgib commented Mar 7, 2016

Author Name: Luigi Pirelli (@luipir)


please check if connection is set-up correctly with the target DB name

@qgib
Copy link
Contributor Author

qgib commented Mar 7, 2016

Author Name: Admire Nyakudya (@NyakudyaA)


When I click on Add postgis layers and define my service configuration I can access the database tables. It is only when I try to access the database using DB manager that it fails to connect

@qgib
Copy link
Contributor Author

qgib commented Mar 7, 2016

Author Name: Luigi Pirelli (@luipir)


again... try to setup dbname in the connection con figuration. dbname is not set in the screenshot you sent.

@qgib
Copy link
Contributor Author

qgib commented Mar 7, 2016

Author Name: Admire Nyakudya (@NyakudyaA)


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.

@qgib
Copy link
Contributor Author

qgib commented Mar 7, 2016

Author Name: Luigi Pirelli (@luipir)


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.

@qgib
Copy link
Contributor Author

qgib commented Mar 14, 2016

Author Name: Tim Sutton (Tim Sutton)


Hi Luigi. For me it is a regression - the behaviour changed from how it worked before in < 2.14 and if you are using a service file then you should not need to set the db name or other connection information since these are specified in the service file.

@qgib
Copy link
Contributor Author

qgib commented Mar 14, 2016

Author Name: Luigi Pirelli (@luipir)


Sorry

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

@qgib
Copy link
Contributor Author

qgib commented Mar 14, 2016

Author Name: Admire Nyakudya (@NyakudyaA)


I currently use basic authentication. I have uploaded a sample service file. [[http://www.postgresql.org/docs/9.1/static/libpq-pgservice.html]]


  • 9700 was configured as pg_service.conf

@qgib
Copy link
Contributor Author

qgib commented Mar 30, 2016

Author Name: Luigi Pirelli (@luipir)


sorry for my late... we are really busy on testing plugins stuffs. I'll be back on this issue in some days

@qgib
Copy link
Contributor Author

qgib commented Apr 9, 2016

Author Name: Giovanni Manghi (@gioman)


  • priority_id was changed from High to Severe/Regression
  • fixed_version_id was changed from Version 2.14 to Version 2.16

@qgib
Copy link
Contributor Author

qgib commented Apr 11, 2016

Author Name: Alessandro Pasotti (@elpaso)


  • assigned_to_id was changed from Luigi Pirelli to Alessandro Pasotti
  • status_id was changed from Open to In Progress

@qgib
Copy link
Contributor Author

qgib commented Apr 12, 2016

Author Name: Anónimo (Anónimo)


Fixed in changeset "212b125a2c2eba93f2c8e3b991ea4be4fdc57623".


  • status_id was changed from In Progress to Closed

@qgib
Copy link
Contributor Author

qgib commented Apr 12, 2016

Author Name: Luigi Pirelli (@luipir)


tnx elpaso

@qgib
Copy link
Contributor Author

qgib commented Apr 12, 2016

Author Name: Paolo Cavallini (@pcav)


Could you please backport it? Thanks.

@qgib
Copy link
Contributor Author

qgib commented Apr 12, 2016

Author Name: Alessandro Pasotti (@elpaso)


I've done it already with 0bde357

@qgib
Copy link
Contributor Author

qgib commented Apr 12, 2016

Author Name: Paolo Cavallini (@pcav)


Great, thanks.

@qgib
Copy link
Contributor Author

qgib commented May 26, 2017

Author Name: Sandro Santilli (@strk)


@qgib
Copy link
Contributor Author

qgib commented May 26, 2017

Author Name: Sandro Santilli (@strk)


@qgib qgib added Bug Either a bug report, or a bug fix. Let's hope for the latter! DB Manager Relating to the DB Manager core plugin labels May 25, 2019
@qgib qgib added this to the Version 2.16 milestone May 25, 2019
@qgib qgib closed this as completed May 25, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Either a bug report, or a bug fix. Let's hope for the latter! DB Manager Relating to the DB Manager core plugin
Projects
None yet
Development

No branches or pull requests

1 participant