I don't understand how Postgres works with openBSD. I didn't have these problems with debian (I don't have to do the initdb).
I did as follow
pkg_add postgresql-server php-pgsql
su - _postgresql
initdb -D /var/postgresql/data -U postgres - E UTF8 -A md5 -W
But after that, I don't have the result that I expect
I can start the database with
pg_ctl -D /var/postgresql/data/ -l logfile start
or with
rcctl enable postgresql
rcctl start postgresql
But I don't understand how to connect to it
Because if I do:
# su - _postgresql
$ psql
Password:
psql: FATAL: password authentication failed for user "_postgresql"
Why it's the _postgresql user and not postgres? Which password I'm supposed to use?
This is the pg_hba.conf, I changed the end,
# TYPE DATABASE USER ADDRESS METHOD
# "local" is for Unix domain socket connections only
local all all trust
# IPv4 local connections:
host all all 127.0.0.1/32
password
# IPv6 local connections:
host all all ::1/128 md5
So with this, I think, i'm login but I have a new probleme, there is really something I don't understand
$ pg_ctl -D /var/postgresql/data/ -l logfile stop
waiting for server to shut down.... done
server stopped
$ pg_ctl -D /var/postgresql/data/ -l logfile start
server starting
$ psql
psql: FATAL: role "_postgresql" does not exist
thanks