#2278 closed defect (fixed)
None
Reported by: | Owned by: | Adrian Holovaty | |
---|---|---|---|
Component: | django-admin.py inspectdb | Version: | 0.91 |
Severity: | normal | Keywords: | None |
Cc: | None | Triage Stage: | Unreviewed |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Pull Requests: | How to create a pull request | ||
Description ¶
runshell in db/backends/postgresql/client.py passes an argument like "-h somehost" to psql. That doesn't work with my psql binary (7.4.13 from Debian unstable); psql takes the space as part of the host name.
I changed the logic to produce argument lists like this:
['-U', 'someuser', '-W', '-h', 'somehost', 'somedb']
instead of this:
['-U someuser', '-W', '-h somehost', 'somedb']
Also, the code inserts a -W option (prompt for password) when a password is configured, not when there isn't. I inverted that logic.
Change History (6)
by , 19 years ago
Attachment: | django-bug-2278.patch added |
---|
comment:1 by , 19 years ago
Summary: | postgres runshell: bad host param, inverted test for -W option → [patch] postgres runshell: bad host param, inverted test for -W option |
---|
comment:2 by , 19 years ago
comment:3 by , 19 years ago
Heh, I just came back to correct myself on the -W thing, but you beat me to it. Don't know what I was thinking on that one.
comment:4 by , 19 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
comment:5 by , 18 years ago
Cc: | added |
---|---|
Component: | Database wrapper → django-admin.py inspectdb |
Keywords: | None added |
Summary: | [patch] postgres runshell: bad host param, inverted test for -W option → None |
Version: | SVN → 0.91 |
The current logic is correct as regards -W: since there is no way to pass the password on the command line to psql, we can at least prompt the user for it when we know a password is going to be required.
Also, we do not want to use -W when there is no password required, because it *always* prompts for a password, before talking to the server and that will be annoying and confusing when the user has already set things up to indicate no password is required.