Am 26.07.2007 um 15:28 schrieb wang jiahui:
> We got an error when we created db with this command:
> [EMAIL PROTECTED]:/opt/postgres/bin$ ./createdb -E UNICODE
> dspace
> createdb: could not connect to database postgres: FATAL: role
> "postgres" does not exist
>
> How could this happen? Doesn't the role "postgres" exist since we
> installed postgresql successfully?
Yes, it should. But obviously, this is not the case.
On the commanc line, try:
% psql
If your are lucky, you get something like this:
Welcome to psql 8.2.4, the PostgreSQL interactive terminal.
Type: \copyright for distribution terms
\h for help with SQL commands
\? for help with psql commands
\g or terminate with semicolon to execute query
\q to quit
postgres=#
The last line shows your default user. If you are not able to log in,
then you probably have to do this as a different user. You might find
the appropriate information in your database configuration files.
More likely, that the database just does not run. You can try
% ps -auxww | grep postgres
to find out. If your database was configured to start at system boot,
then there might be errors that prevent it from starting. They should
be logged - unless access to the log directory is the culprit. Do you
have a postgres log file? What does it say? Reasons could be that any
of the required files are either missing or inaccessible due to bad
privileges - the data directory must be readable and writeable only
to the postgres unix user account. Check all this before trying to
connect to the database again. You find more information in the
postgres docs.
If you get the server running, then you can try again to create the
db user dspace and run createdb. If it still fails (which is very
unlikely), then connect using psql and type either one of the next
two commands and send the results to the list.
postgres=# \du
List of roles
Role name | Superuser | Create role | Create DB | Connections |
Member of
-----------+-----------+-------------+-----------+-------------
+-----------
dspace | no | no | yes | no limit |
postgres | yes | yes | yes | no limit |
(2 rows)
postgres=# \l
List of databases
Name | Owner | Encoding
-------------+----------+-----------
dspace | dspace | UTF8
dspace_test | dspace | UTF8
postgres | postgres | SQL_ASCII
template0 | postgres | SQL_ASCII
template1 | postgres | SQL_ASCII
(5 rows)
Bye, Christian
-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
DSpace-tech mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/dspace-tech