Connect to template1 when getting the list of databases.

We can't assume that the user will have a database that shares their
user name.
This commit is contained in:
J Smith 2012-09-10 01:00:08 -04:00
parent 98f5f1abc1
commit c5a5033e08
1 changed files with 1 additions and 1 deletions

View File

@ -104,7 +104,7 @@ _pgsql_databases () {
_pgsql_db_sql="select d.datname from pg_catalog.pg_database d \ _pgsql_db_sql="select d.datname from pg_catalog.pg_database d \
where d.datname <> 'template0'" where d.datname <> 'template0'"
compadd "$@" - $( psql $_pgsql_params[@] -Atq -c $_pgsql_db_sql 2>/dev/null ) compadd "$@" - $( psql $_pgsql_params[@] -Atq -c $_pgsql_db_sql template1 2>/dev/null )
} }