python - Postgresql: "database does not exist" -
following postgresql installation instructions mac, created db , launched server. looks it's working fine.
/opt/local/lib/postgresql93/bin/postgres -d /opt/local/var/db/postgresql93/defaultdb log: database system shut down @ 2013-08-12 15:36:09 pdt log: database system ready accept connections log: autovacuum launcher started
however, when try access database python3 django, following error:
operationalerror: fatal: database "/opt/local/var/db/postgresql93/defaultdb" not exist
if go directory, defaultdb, see exists , there many files in it.
aside above error message appearing in python traceback, appears in postgres log:
fatal: database "defaultdb" not exist fatal: database "/opt/local/var/db/postgresql93/defaultdb" not exist
i've tried replacing full path name "defaultdb", same message.
edit: in fact, running following doesn't work either:
/opt/local/bin/psql93 defaultdb psql93: fatal: database "defaultdb" not exist
initdb
creates cluster global data directory (the path after -d
). data directory container collection of databases plus information shared across databases (like table of users or database journal files). there 1 cluster per postgresql installation many databases want inside cluster.
createdb
creates database inside cluster not manipulate directly file system, rather issues create database
sql statement after being connected server. databases not refered paths names, contrary global data directory designates path on disk.
special databases named template0
, template1
, postgres
automatically created new cluster don't want store application data them.
it seems misunderstanding believing creating cluster created database @ same time or not knowing distinction between both. cluster automatically set installation phase whereas creating databases left user.
Comments
Post a Comment