From d1b88f5512b1623b22d71ec4aa74655ecd487430 Mon Sep 17 00:00:00 2001 From: Steve Purcell Date: Wed, 28 May 2008 15:58:54 +0200 Subject: [PATCH] Support PostgreSQL connections with no username set --- tasks/db_console.rake | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tasks/db_console.rake b/tasks/db_console.rake index e2ee268..236254c 100644 --- a/tasks/db_console.rake +++ b/tasks/db_console.rake @@ -24,10 +24,11 @@ namespace :db do '--default-character-set', config["encoding"], '-D', config["database"]) when "postgresql" + ENV['PGUSER'] = config["username"] if config["username"] ENV['PGHOST'] = config["host"] if config["host"] ENV['PGPORT'] = config["port"].to_s if config["port"] ENV['PGPASSWORD'] = config["password"].to_s if config["password"] - system(find_cmd('psql'), '-U', config["username"], config["database"]) + system(find_cmd('psql'), config["database"]) when "sqlite" system(find_cmd('sqlite'), config["database"]) when "sqlite3"