Opened 18 years ago

Closed 18 years ago

Last modified 17 years ago

#2278 closed defect (fixed)

None

Reported by: hawk@… 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

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.

Attachments (1)

django-bug-2278.patch (830 bytes ) - added by hawk@… 18 years ago.

Download all attachments as: .zip

Change History (6)

by hawk@…, 18 years ago

Attachment: django-bug-2278.patch added

comment:1 by anonymous, 18 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 Malcolm Tredinnick, 18 years ago

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.

comment:3 by anonymous, 18 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 Malcolm Tredinnick, 18 years ago

Resolution: fixed
Status: newclosed

(In [3278]) Fixed #2278 -- Fixed some argument parsing problems with the PostgreSQL
dbshell. Also added in the process name to the arg list so that the output of
'ps' looks sensible.

comment:5 by anonymous, 17 years ago

Cc: None added
Component: Database wrapperdjango-admin.py inspectdb
Keywords: None added
Summary: [patch] postgres runshell: bad host param, inverted test for -W optionNone
Version: SVN0.91
Note: See TracTickets for help on using tickets.
Back to Top