Bug report #3489
Missing DB name in Add PostGis layer gives no useful warning
|Affected QGIS version:||master||Regression?:||No|
|Operating System:||Easy fix?:||No|
|Pull Request or Patch supplied:||No||Resolution:|
|Crashes QGIS or corrupts data:||No||Copied to github as #:||13549|
When creating a new connection to a PostGis DB, if the DB name is left empty the user is given the following messages:
Database connection was successful, but the accessible tables could not be determined.
Database connection was successful, but no accessible tables were found. Please verify that you have SELECT privilege on a table carrying [[PostGIS]] geometry.
It would be good to mention that a DB name is mandatory.
#7 Updated by Médéric RIBREUX almost 5 years ago
- Status changed from Open to Feedback
- Pull Request or Patch supplied set to No
- Operating System changed from Debian to All
- Assignee deleted (
Hello, bug triage...
on QGIS 2.13 master (and probably with previous versions), when you create a connection without a DB name, the connection is made to a DB which has the name of the connected user. You can choose a name for the connection and you can, of course, add the name of the DB in this name (coupled with the username or the role), but this is not mandatory and you can write whatever you want.
In DB Manager (successor of PostGIS Manager), connections are now used instead of DB name. Actually, you can't find the name of the DB in DBManager anymore.
So what do we do with this bug ? Should we:
- Add DB name in the connection dialog box (perhaps inside parenthesis after the name of the connection) ?
- Add DB name in DB Manager inside parenthesis after the name of the connection and/or in a field on the connection details tab ?
- Add both ?
- Do nothing and we close this bug by saying it is user responsibility to correctly name his/her connection (after all, the DB name can be viewed by editing the connection configuration) !
#8 Updated by Sebastian Dietrich almost 5 years ago
- Add DB name in DB Manager
inside parenthesis after the name of the connection and/orin a field on the connection details tab?
- The connection name is a user defined property and if the user finds a need to have the DB name inside it he can just put it there. Probably some users already did so.
- The connection name is meant to be a key to look up a connection. And as such it must not change when a property of the connection it points to changes. This would make it sort of a hash, not a key. All saved projects/layers that contain the old key would break in this case.
- The DB name (and in fact all other fields, too) can be filled by environment variables. So a call to PQconndefaults() is mandatory to fetch the desired information.