Re: Recover PostgreSQL database folder data

From: Magnus Hagander <magnus(at)hagander(dot)net>
To: Cat <cat(at)zip(dot)com(dot)au>
Cc: Edson Lidorio <edson(at)openmailbox(dot)org>, "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Re: Recover PostgreSQL database folder data
Date: 2017-04-22 09:40:38
Message-ID: CABUevEy5x1yJn7JaU0jQrRNjo-Af8dbj8xtBWfH73hSk_p_FRQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Sat, Apr 22, 2017 at 3:05 AM, Cat <cat(at)zip(dot)com(dot)au> wrote:

> On Fri, Apr 21, 2017 at 08:20:38PM -0300, Edson Lidorio wrote:
> > Ls -la /var/lib/pgsql/9.6/data
> >
> > drwx------. 20 postgres postgres 4096 Abr 21 17:52 .
> > drwx------. 4 root root 51 Abr 21 06:33 ..
>
> Ensure that the user 'postgres' has permissions to get to
> this dir from / up. This may either mean changing permissions
> on some directories or changing ownership.
>
> More than likely / /var /lib are a permissions thing (likely
> need to be u+rwx,g+rx,o+rx) and /var/lib/pgsql/ and up is an
> ownership thing (postgres:postgres) but this is not guaranteed
> so take care.

Since this is CentOS, I would also look into if it's selinux things that
are incorrect. The easiest way is to turn it off and see if that fixes it
-- if it does, then read up on the selinux docs for how to figure out what
is wrong and probably use restorecon to get things back in order.

--
Magnus Hagander
Me: https://www.hagander.net/ <http://www.hagander.net/>
Work: https://www.redpill-linpro.com/ <http://www.redpill-linpro.com/>

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Edson Lidorio 2017-04-22 14:11:20 Re: Recover PostgreSQL database folder data
Previous Message John R Pierce 2017-04-22 09:38:08 Re: pg_basebackup issue