# Why PostgreSQL does not have the folder "data"?



## Orige (Feb 10, 2010)

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?


----------



## thuglife (Feb 10, 2010)

You have to run initdb.

`# /usr/local/etc/rc.d/postgresql initdb`


----------



## volatilevoid (Feb 10, 2010)

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.


----------



## Orige (Feb 11, 2010)

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:

```
psql: FATAL:  role "postgres" does not exist
```


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


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

Thanks for your attention..


----------



## volatilevoid (Feb 11, 2010)

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.


----------

