I installed the postgres10.4 snap and I want to start it with a certain data directory where the database is located. But I fail to do that.
postgresql10.postgres -D ~/db/data
WARNING: cgroup v2 is not fully supported yet, proceeding with partial confinement
postgres: could not access directory "/home/tk/db/data": No such file or directory
Run initdb or pg_basebackup to initialize a PostgreSQL data directory.
I tried several ways and I seem to not understand some concepts here. Also no documentation on the snaps webpage.
I tried to be smart by letting it create a db itself and search for it, but this also failed.
postgresql10.initdb -D test_pg
WARNING: cgroup v2 is not fully supported yet, proceeding with partial confinement
The files belonging to this database system will be owned by user ātkā.
This user must also own the server process.
fd test_pg /
fd found nothing
Ok, I found /home/tk/snap/postgresql10/current and indeed, if I create a folder there, I can try to start the DB from that.
But I can not copy my DB into that folder as it is too big and on another partition.
I tried a symbolic link, but seems like snap just ignored itā¦ So still no solution.
I found a solution. Apparently snap only allows access to paritions that are mounted under /home/
So I mounted the partition there and then the symbolic links mentioned above did work.
But then I got other issues, the locale was not set and the db still didnāt start up, so I ended up compiling the source myself, which luckily was staight forward.
Download & extract src
./configure
make
make install
useradd -m postgres
Oh, I see, you meant āThe reason I dont use the repo package is because I need a different versionā, not āyes, I need the version in the repositoriesā