From: Adrian Klaver <adrian.klaver@aklaver.com>
To: Matthias Apitz <guru@unixarea.de>
Cc: Marco Ippolito <ippolito.marco@gmail.com>
Cc: pgsql-general@lists.postgresql.org
Subject: Re: Installed PostgreSQL-11 in Ubuntu 18.04.02 Server Edition: No existing local cluster is suitable as a default target
Date: Wed, 18 Sep 2019 07:59:12 -0700
Message-ID: <ce3d3e0d-93d4-5db2-68f0-3b07f16691f5@aklaver.com> (raw)
In-Reply-To: <20190918144901.GA3103@c720-r342378>
References: <CAFegzBRjjrzv2mPTi4_dYAZjqvL951CbfRffngnCmmy5jN1QRA@mail.gmail.com>
<VisenaEmail.56.bae53721737ec52e.16d43e8f7e1@tc7-visena>
<CAFegzBQ-mO076Xrs7KSLeZCDXw3JzA6R3kTm4y1W64zDGDnrvg@mail.gmail.com>
<20190918131106.GA167414@sh4-5.1blu.de>
<CAFegzBT5_GSQbRTpamocdJL8GqPHrFJ+DGG=pChc6-Lh8nJmAQ@mail.gmail.com>
<793c3697-dc15-973b-575e-e269cf3b0cad@aklaver.com>
<20190918144901.GA3103@c720-r342378>
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.klaver@aklaver.com
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-general@postgresql.org
Cc: adrian.klaver@aklaver.com, guru@unixarea.de, ippolito.marco@gmail.com
Subject: Re: Installed PostgreSQL-11 in Ubuntu 18.04.02 Server Edition: No existing local cluster is suitable as a default target
In-Reply-To: <ce3d3e0d-93d4-5db2-68f0-3b07f16691f5@aklaver.com>
References: <CAFegzBRjjrzv2mPTi4_dYAZjqvL951CbfRffngnCmmy5jN1QRA@mail.gmail.com> <VisenaEmail.56.bae53721737ec52e.16d43e8f7e1@tc7-visena> <CAFegzBQ-mO076Xrs7KSLeZCDXw3JzA6R3kTm4y1W64zDGDnrvg@mail.gmail.com> <20190918131106.GA167414@sh4-5.1blu.de> <CAFegzBT5_GSQbRTpamocdJL8GqPHrFJ+DGG=pChc6-Lh8nJmAQ@mail.gmail.com> <793c3697-dc15-973b-575e-e269cf3b0cad@aklaver.com> <20190918144901.GA3103@c720-r342378> <ce3d3e0d-93d4-5db2-68f0-3b07f16691f5@aklaver.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox