From c5a5033e0810dde8858b2aa10b15a3a883fb95d7 Mon Sep 17 00:00:00 2001 From: J Smith Date: Mon, 10 Sep 2012 01:00:08 -0400 Subject: [PATCH] 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. --- src/_pgsql_utils | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/_pgsql_utils b/src/_pgsql_utils index 2a8dffd..19281b9 100644 --- a/src/_pgsql_utils +++ b/src/_pgsql_utils @@ -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 ) }