Code

Opened 8 years ago

Closed 8 years ago

Last modified 7 years ago

#2278 closed defect (fixed)

None

Reported by: hawk@… Owned by: adrian
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: UI/UX:

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@… 8 years ago.

Download all attachments as: .zip

Change History (6)

Changed 8 years ago by hawk@…

comment:1 Changed 8 years ago by anonymous

  • Summary changed from postgres runshell: bad host param, inverted test for -W option to [patch] postgres runshell: bad host param, inverted test for -W option

comment:2 Changed 8 years ago by mtredinnick

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 Changed 8 years ago by anonymous

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 Changed 8 years ago by mtredinnick

  • Resolution set to fixed
  • Status changed from new to closed

(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 Changed 7 years ago by anonymous

  • Cc None added
  • Component changed from Database wrapper to django-admin.py inspectdb
  • Keywords None added
  • Summary changed from [patch] postgres runshell: bad host param, inverted test for -W option to None
  • Version changed from SVN to 0.91

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.