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?

link|improve this question

70% accept rate
feedback

1 Answer

up vote 0 down vote accepted

Connect to template1 database and use pgsql user:

 # su pgsql
 $ psql template1

or

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

Your Answer

 
or
required, but never shown

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