On 9/18/19 7:49 AM, Matthias Apitz wrote:
El día miércoles, septiembre 18, 2019 a las 07:41:41a. m. -0700, Adrian Klaver 
escribió:

On 9/18/19 6:13 AM, Marco Ippolito wrote:
Thanks Matthias,
very kind. Hopefully I will get some hints on how to solve my problem.

You should probably take a look at:

https://help.ubuntu.com/lts/serverguide/postgresql.html

FYI, you should set the permission son /usr/lib/postgresql back to root
and use:

sudo pg_ctl <command>

NAK. In my understanding, the dir above the data dir of the cluster
should be owned by 'postgres' and the pg_ctl run as 'postgres':


# mkdir /data/postgresql11
# chown postgres /data/postgresql11
# su - postgres
$ LANG=de_DE.UTF-8 export LANG
$ /usr/local/sisis-pap/pgsql/bin/pg_ctl -D /data/postgresql11/data initdb

This is stolen from the pages mentioned, i.e. 
https://www.postgresql.org/docs/11/runtime.html
(chapter 18. Server Setup and Operation) and worked out of the box fine
for me.

Its a recommendation and not what the Debian/Ubuntu packaging does.
From a Ubuntu 16.04.6 LTS install:

aklaver@arkansas:~$ ls -al /usr/lib/postgresql/
total 24
drwxr-xr-x  4 root root  4096 May 24 09:57 .
drwxr-xr-x 49 root root 12288 Mar  5  2019 ..
drwxr-xr-x  4 root root  4096 Mar 17  2018 10
drwxr-xr-x  4 root root  4096 Oct 20  2018 11

aklaver@arkansas:~$ l /var/lib/postgresql/
total 32
drwxr-xr-x  6 postgres postgres 4096 May 29 13:26 ./
drwxr-xr-x 41 root     root     4096 May 24 09:47 ../
drwxr-xr-x  3 postgres postgres 4096 Mar 17  2018 10/
drwxr-xr-x  3 postgres postgres 4096 Oct 20  2018 11/
-rw-------  1 postgres postgres  120 May 24 15:07 .bash_history
drwx------  2 postgres postgres 4096 May 24 15:07 .cache/
-rw-rw-r--  1 postgres postgres    0 May 29 13:27 cat
-rw-------  1 postgres postgres   90 Feb 11  2017 .psql_histor

From local source install:

postgres@tito:~> l /usr/local/pgsql11
total 28
drwxr-xr-x  7 root     root     4096 Jan  4  2019 ./
drwxr-xr-x 18 root     root     4096 Jul  6 13:54 ../
drwxr-xr-x  2 root     root     4096 Aug 26 17:41 bin/
drwx------ 20 postgres postgres 4096 Sep 18 06:27 data/
drwxr-xr-x  6 root     root     4096 Aug 26 17:41 include/
drwxr-xr-x  4 root     root     4096 Sep 11 07:38 lib64/
drwxr-xr-x  6 root     root     4096 Aug 26 17:41 share/


As long as the data directory is owned by postgres all is good.


        matthias




--
Adrian Klaver
adrian.kla...@aklaver.com


Reply via email to