Following the postgresql installation instructions for Mac, I recently created a db and launched the server. Everything looks like it's working fine.
/opt/local/lib/postgresql93/bin/postgres -D /opt/local/var/db/postgresql93/defaultdb
LOG: database system was shut down at 2013-08-12 15:36:09 PDT
LOG: database system is ready to accept connections
LOG: autovacuum launcher started
However, when I try to access the database from Python3 Django, I get the following error:
OperationalError: FATAL: database "/opt/local/var/db/postgresql93/defaultdb" does not exist
If I go into that directory, defaultdb, I see that it exists and there are many files in it.
Aside from the above error message appearing in the Python traceback, it also appears in the postgres log:
FATAL: database "defaultdb" does not exist
FATAL: database "/opt/local/var/db/postgresql93/defaultdb" does not exist
I've also tried replacing the full path with just the name "defaultdb", but get the same message.
EDIT: In fact, running the following doesn't work either:
/opt/local/bin/psql93 defaultdb
psql93: FATAL: database "defaultdb" does not exist
/opt/local/bin/psql93 --listshow "defaultdb" in the output?