bash_completion fails for psql when databases require a password

Bug #164772 reported by Richard G. Clegg
6
Affects Status Importance Assigned to Milestone
bash-completion (Ubuntu)
Fix Released
Undecided
Mika Fischer

Bug Description

Binary package hint: bash

Because in many circumstances autocompletion on psql triggers database lookups, the command fails in an unexpected way if the postgres database by default requires a password. The solution is to remove _pg_users and _pg_databases routines from bash_completion.

Revision history for this message
Mika Fischer (zoop) wrote :

I've written the PostgreSQL developers about a way to avoid the password prompt. Let's see what they answer.

Since this is useful and works in the default configuration, I'd tend to leave it on for now...

Changed in bash-completion:
status: New → Confirmed
Revision history for this message
Mika Fischer (zoop) wrote :

There doesn't seem to be a way to do this currently, since psql has no way to suppress the password prompt. However, there are a few developers who would like bash-completion to work, so maybe we'll see something in the next release that allows bash_completion to do this reliably.

But for the time being I'll have to disable the user and database completion since it can't be done reliably.

Changed in bash-completion:
assignee: nobody → zoop
status: Confirmed → In Progress
Mika Fischer (zoop)
Changed in bash-completion:
status: In Progress → Fix Committed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package bash-completion - 20060301-3ubuntu2

---------------
bash-completion (20060301-3ubuntu2) hardy; urgency=low

  * Bugfix release:
   - Fix _get_cword more
   - Fix _command function to correctly prune the command line (LP: #103395)
   - Remove newline from options pattern for dpkg (LP: #138312)
   - Start readline-quoting arguments to compgen (LP: #123665)
   - Save and restore -v shell option (LP: #205444)
   - Prevent glob expansion in _filedir function (LP: #194419)
   - Quote glob expression in tar completion function (LP: #194419)
   - Complete AAS/SSA files for mplayer -sub (LP: #151086)
   - Disable completion of postgresql users and databases (LP: #164772)
   - Use files from UserKnownHostsFile options in addition to standard ones
     (LP: #211180)

 -- Mika Fischer <email address hidden> Sat, 05 Apr 2008 16:09:34 +0200

Changed in bash-completion:
status: Fix Committed → Fix Released
Revision history for this message
Peter Eisentraut (petere) wrote :

PostgreSQL 9.0 has the psql option --no-password/-w, which is what you want to use. It should be OK to also use this in older versions because they will just fail and print nothing, which is no worse than the disabled state now.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.