Browse files

dbconsole should not require a username for postgresql. [#207 state:r…

…esolved]

Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
  • Loading branch information...
1 parent 1507173 commit 77f873acf2f1fb4533dfca6b26b965a115ebbc54 @pd pd committed with lifo May 16, 2008
Showing with 2 additions and 1 deletion.
  1. +2 −1 railties/lib/commands/dbconsole.rb
View
3 railties/lib/commands/dbconsole.rb
@@ -40,10 +40,11 @@ def find_cmd(*commands)
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"])

0 comments on commit 77f873a

Please sign in to comment.