I want to set up a PostgreSQL database but initdb
hits an authentication error. I seem to be doing as described in docs.
- I log in as postgres user with
doas -u postgres -s
(AFAIK it's same assu - postgres
) cd
to/home/user/A/B/postgres
.stat .
yields
Access: (0700/drwx------) Uid: ( 965/postgres) Gid: ( 965/postgres)
id
yields
uid=965(postgres) gid=965(postgres) groups=965(postgres)
- Running
initdb -D /home/user/A/B/data
results in an error with:
could not change directory to "/home/user/A/B/postgres": Permission denied
The files belonging to this database system will be owned by user "postgres". This user must also own the server process.
The database cluster will be initialized with locale "C". The default database encoding has accordingly been set to "SQL_ASCII". The default text search configuration will be set to "english".
Data page checksums are disabled.
initdb: error: could not access directory "/home/user/A/B/postgres/data": Permission denied
This or similar error is hit with or without the directory data
created beforehand and also using both relative and absolute paths. The folders A and B in the path are not owned by postgres.
I'm using postgresql 13.4-6 on manjaro with doas for authentication and sudo uninstalled.