pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Adrian Klaver <adrian.klaver@aklaver.com>
To: Atul Kumar <akumar14871@gmail.com>
To: pgsql-general <pgsql-general@lists.postgresql.org>
Subject: Re: issue with remote backup
Date: Thu, 26 Oct 2023 10:21:49 -0700
Message-ID: <8ab137e5-8dc4-4444-93bb-802cf37ae948@aklaver.com> (raw)
In-Reply-To: <CA+ONtZ5Cuct0_x6pE=k-8fMPFeBp-i2TBZ-U3=agqadUER2FFA@mail.gmail.com>
References: <CA+ONtZ5Cuct0_x6pE=k-8fMPFeBp-i2TBZ-U3=agqadUER2FFA@mail.gmail.com>

On 10/26/23 09:51, Atul Kumar wrote:
> Hi,
> 
> I have the postgres12 version running on centos7.
> 
> In pg_hba.conf file I have an entry like below:
> 
> host    all             all             <remote server ip>/32            md5
> 
> So from the above entry, I understand that all users can connect to all 
> databases from the remote ip.
> 
> 
> But when I use pg_basebackup from remote server using below command I 
> get the below error:
> 
> pg_basebackup -h DB_server_hostname -p 5444 -U postgres -D 
> /var/lib/edb/backups/10262023_1 -Fp -Xs -c fast -P
> 
> Error that I got:
> 
> pg_basebackup: error: FATAL:  no pg_hba.conf entry for replication 
> connection from host "remote_ip", user "postgres", SSL off
> 
> So please help me understand why I am getting this error even after 
> having a related entry in the pg_hba.conf file.


https://www.postgresql.org/docs/current/auth-pg-hba-conf.html

"
database

     Specifies which database name(s) this record matches. The value all 
specifies that it matches all databases. The value sameuser specifies 
that the record matches if the requested database has the same name as 
the requested user. The value samerole specifies that the requested user 
must be a member of the role with the same name as the requested 
database. (samegroup is an obsolete but still accepted spelling of 
samerole.) Superusers are not considered to be members of a role for the 
purposes of samerole unless they are explicitly members of the role, 
directly or indirectly, and not just by virtue of being a superuser. The 
value replication specifies that the record matches if a physical 
replication connection is requested, however, it doesn't match with 
logical replication connections. Note that physical replication 
connections do not specify any particular database whereas logical 
replication connections do specify it. Otherwise, this is the name of a 
specific PostgreSQL database or a regular expression. Multiple database 
names and/or regular expressions can be supplied by separating them with 
commas.

     If the database name starts with a slash (/), the remainder of the 
name is treated as a regular expression. (See Section 9.7.3.1 for 
details of PostgreSQL's regular expression syntax.)

     A separate file containing database names and/or regular 
expressions can be specified by preceding the file name with @.

"

> 
> 
> 
> 
>   Regards.

-- 
Adrian Klaver
adrian.klaver@aklaver.com






view thread (3+ messages)

Message-ID: <8ab137e5-8dc4-4444-93bb-802cf37ae948@aklaver.com>
Permalink:  ../8ab137e5-8dc4-4444-93bb-802cf37ae948@aklaver.com/
Also on:    postgresql.org/message-id/8ab137e5-8dc4-4444-93bb-802cf37ae948@aklaver.com

 · 

reply

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, akumar14871@gmail.com
  Subject: Re: issue with remote backup
  In-Reply-To: <8ab137e5-8dc4-4444-93bb-802cf37ae948@aklaver.com>
  References: <CA+ONtZ5Cuct0_x6pE=k-8fMPFeBp-i2TBZ-U3=agqadUER2FFA@mail.gmail.com> <8ab137e5-8dc4-4444-93bb-802cf37ae948@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