-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
[processing] Do not override libpq defaults #3607
[processing] Do not override libpq defaults #3607
Conversation
not sure how to test this, as the function building the connection string is the same building the whole commandline, maybe they should be split to allow for easier unit testing... |
There should be a default. Otjherwise, users will have to manually type host and port everytime, so this change will mean a regression in terms of UX. The part of the code you added to the eecution method is fine, we can keep that, but let's at least have 5432 and 'localhost' as default values, to make it easier to call the algorithm in the most usual case |
Isn't the connection string derived from existing connections ? |
I've just tried "Import Vector into PostGIS database (new connection)" and I confirm it works fine even if I don't feel any of the Host,Database,User,Password fields (as it then correctly rely on libpq defaults) |
Actually, I'd drop the "active_schema" default too.. |
I would note that the current defaults would mostly be the libpq defaults for most people, so omitting them would not change the experience of anyone with a default PostgreSQL install. The only difference would be not seeing the defaults written in the form. With latest commit I made it clear that those parameters are optional |
cdd96eb
to
be3e807
Compare
Ok I've refactored the code to not change the UX. I've been thinking that a power user would know what to do better than a non-power user. So we're back to the need for a testcase |
Ok @volaya I've now added unit test for the connection string, moving it to its own function. |
Fixes http://hub.qgis.org/issues/15706
Superceeds #3604
\cc @volaya