Rake tasks aborting with weird postgres issue

Hey guys, if anyone could help me here I’d really appreciate it.

I’ve recently switched to Rails 2.1, and having a hard time with rake
tasks and postgres. When I try run anything that involves
db:test:purge it tell me that the “postgres” database doesn’t exist.
I’m not trying to connect to the “postgres” database tho. I first hit
this problem when trying db:test:clone, but the same thing happens
with rspec rake tasks, if I run the tasks with --trace they all seem
to cry at db:test:purge. Now from postgres’ perspective, trying to
connect to “postgres” would happen if I’m trying to connect as the
postgres user without specifying a db, but I’m not 100% sure that’s
the problem, and dont know where it’s getting confused even if it is.
My database.yml file is right, and it’s set up to connect as the db
user that owns the dev and test databases in question. I’ve even
tried setting that user as a postgres superuser, but still no luck.

I can connect to the db in script/console… it’s just via rake that
it has issues.

Here’s a trace (full stack trace not included, I can supply it if
needed tho):

rake db:test:clone --trace
(in /home/nic/work/smmt)
** Invoke db:test:clone (first_time)
** Invoke db:schema:dump (first_time)
** Invoke environment (first_time)
** Execute environment
** Execute db:schema:dump
** Invoke db:test:purge (first_time)
** Invoke environment
** Execute db:test:purge
rake aborted!
FATAL: database “postgres” does not exist

Anybody got any advice?? This is killing me.



I need some tutorial on Ruby. It seems to be very
interesting package. advise what do i do so that i
become an expert? am already good at MS Access,
FrontPage, DreamWeaver and a bit of DotNetNuke.