None
    
    
    
      
      
      
        
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)
        
          
          
  
  
  
    
      | Summary: | 
      
        postgres runshell: bad host param, inverted test for -W option → [patch] postgres runshell: bad host param, inverted test for -W option
       | 
    
  
 
           
          
          
          
  
  
  
    
      | Resolution: | 
      
        → fixed
       | 
    
    
      | Status: | 
      
        new → closed
       | 
    
  
 
           
          
  
  
  
    
      | Cc: | 
      
        None 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.