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:
parent
98f5f1abc1
commit
c5a5033e08
|
@ -104,7 +104,7 @@ _pgsql_databases () {
|
|||
_pgsql_db_sql="select d.datname from pg_catalog.pg_database d \
|
||||
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 )
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue