From 77f873acf2f1fb4533dfca6b26b965a115ebbc54 Mon Sep 17 00:00:00 2001 From: Kyle Hargraves Date: Fri, 16 May 2008 06:51:39 -0500 Subject: [PATCH] dbconsole should not require a username for postgresql. [#207 state:resolved] Signed-off-by: Pratik Naik --- railties/lib/commands/dbconsole.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/railties/lib/commands/dbconsole.rb b/railties/lib/commands/dbconsole.rb index 3e5010c688..b81997aa59 100644 --- a/railties/lib/commands/dbconsole.rb +++ b/railties/lib/commands/dbconsole.rb @@ -40,10 +40,11 @@ when "mysql" exec(find_cmd('mysql5', 'mysql'), *args) 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"] - exec(find_cmd('psql'), '-U', config["username"], config["database"]) + exec(find_cmd('psql'), config["database"]) when "sqlite" exec(find_cmd('sqlite'), config["database"])