Re: issue with remote backup

From: Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com>
To: Atul Kumar <akumar14871(at)gmail(dot)com>, pgsql-general <pgsql-general(at)lists(dot)postgresql(dot)org>
Subject: Re: issue with remote backup
Date: 2023-10-26 17:21:49
Message-ID: 8ab137e5-8dc4-4444-93bb-802cf37ae948@aklaver.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

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(dot)klaver(at)aklaver(dot)com

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Imre Samu 2023-10-26 17:45:33 Re: Question regarding the new SQL standard
Previous Message Tom Lane 2023-10-26 17:15:34 Re: issue with remote backup