Why PostgreSQL does not have the folder "data"?

When I install any version of Postgresql with ports , the installation not make the directory /usr/local/pgsql/data.
In FreeBSD 7.2 the installation is normal.
I'm using the FreeBSD 8 stable.

What's happening?
 
You need to run # initdb --pgdata=/usr/local/pgsql/data manually as user pgsql. The advantage is that you can specify an encoding and some other options. Running # /usr/local/etc/rc.d/postgresql initdb is fine too.
 
Men,
thanks for help with my thread.
But I have other..

When I try run the psql -l command , the system show me one error:
Code:
psql: FATAL:  role "postgres" does not exist


I tried create user postgres .. but don't work too.

Code:
createuser -s postgres
createuser: could not connect to database postgres: FATAL:  role "postgres" does not exist

Thanks for your attention..
 
This user should normally be created by initdb. Are you sure the script finished without errors? Did you use # initdb --pgdata=/usr/local/pgsql/data or # /usr/local/etc/rc.d/postgresql initdb?

If you're unsure, you can delete /usr/local/pgsql/data and run initdb again.
 
Back
Top