Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have installed PostgreSQL 8.4 with pkg_add -r postgres84-server. I added 'postgresql_enable="YES"to/etc/rc.conf, and executed/usr/local/etc/rc.d/postgresql initdb`.

And when I run psql to start, it printed these errors:

%psql
psql: FATAL:  database "eonil" does not exist
%psql -U postgres
psql: FATAL:  role "postgres" does not exist
%psql -U psql
psql: FATAL:  database "psql" does not exist
%psql -U pgsql
psql: FATAL:  database "pgsql" does not exist
%sudo psql 
psql: FATAL:  database "root" does not exist
%sudo -u pgsql psql
psql: FATAL:  database "pgsql" does not exist
%sudo -u psql psql
sudo: unknown user: psql
%

How can I run PostgreSQL console? What's required?

share|improve this question

1 Answer 1

up vote 0 down vote accepted

Connect to template1 database and use pgsql user:

 # su pgsql
 $ psql template1

or

 $ sudo -u pgsql psql template1
share|improve this answer
    
I connected to default database postgres with command sudo -u pgsql psql postgres. Thanks! –  Eonil Feb 27 '11 at 10:23

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.