From: Adrian Klaver <adrian.klaver@aklaver.com>
To: robert rottermann <robert@redcor.ch>
To: pgsql-general@postgresql.org <pgsql-general@postgresql.org>
Subject: Re: how to set permission, so I can run pg_dumd in a cron job
Date: Sat, 13 Mar 2021 09:37:33 -0800
Message-ID: <2879d30f-e295-67bb-d906-710c2ec505b5@aklaver.com> (raw)
In-Reply-To: <5eb2f955-8bfe-0b84-72ac-0110fb2b4c29@redcor.ch>
References: <08762210-ad92-7b0d-a1bc-45301bd76582@redcor.ch>
<aa20ac61-d965-5f77-ca1e-6d4b32d071f5@aklaver.com>
<5eb2f955-8bfe-0b84-72ac-0110fb2b4c29@redcor.ch>
On 3/13/21 9:25 AM, robert rottermann wrote:
>
> Adrin, thanks
>
>>> can you please give me a hand
>>
>> 1) Did you have the server reload the conf files after making the
>> changes?
> yes I did
>>
>> 2) Is there an entry for something like:
>>
>> local all all peer
>>
>> before the lines you show above?
>
> no
>
> I added the whol pg_conf at the end.
>
> There is one thing particulare with the installation.
>
> I have postgresql 9.5 and 10.0 on the box.
>
> now when I check
>
> pg_dump -V
> pg_dump (PostgreSQL) 9.5.24
>
> root@elfero:~# ll /usr/bin/pg_dump
> lrwxrwxrwx 1 root root 37 Nov 13 2019 /usr/bin/pg_dump ->
> ../share/postgresql-common/pg_wrapper*
>
> when I switch to user postgres, and the us psql, I get the following:
>
> root@elfero:~# su postgres
> postgres@elfero:/root$ psql -d elfero
> could not change directory to "/root": Permission denied
> psql (10.16 (Ubuntu 10.16-0ubuntu0.18.04.1), server 9.5.24)
> Type "help" for help.
>
> looks, as if I have a mess with this two instances.
>
>
> How can I best clean that up.
>
> I need only PostgreSQL 10
From command line what does pg_lsclusters show?
Which pg_hba.conf file did you change? The one in:
/etc/postgresql/9.5/main
or
/etc/postgresql/10/main
To specify a version of pg_dump to use do something like:
pg_dump --cluster 10/main -d some_db -U some_user -p some_port
The important part is the some_port. You will need to use the one
specified for the instance(cluster) as returned by the pg_lscluster command.
>
> thanks again
>
> robert
>
>
> # Database administrative login by Unix domain socket
> #local all postgres peer
> # TYPE DATABASE USER ADDRESS METHOD
> # "local" is for Unix domain socket connections only
> local all all trust
> # IPv4 local connections:
> host all all 127.0.0.1/32 trust
> q# IPv6 local connections:
> host all all ::1/128 md5
> # Allow replication connections from localhost, by a user with the
> # replication privilege.
> local replication all peer
> host replication all 127.0.0.1/32 md5
> host replication all ::1/128 md5
--
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, robert@redcor.ch
Subject: Re: how to set permission, so I can run pg_dumd in a cron job
In-Reply-To: <2879d30f-e295-67bb-d906-710c2ec505b5@aklaver.com>
References: <08762210-ad92-7b0d-a1bc-45301bd76582@redcor.ch> <aa20ac61-d965-5f77-ca1e-6d4b32d071f5@aklaver.com> <5eb2f955-8bfe-0b84-72ac-0110fb2b4c29@redcor.ch> <2879d30f-e295-67bb-d906-710c2ec505b5@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