Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1ihyvA-0000NG-Uc for pgadmin-support@arkaria.postgresql.org; Thu, 19 Dec 2019 16:45:05 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1ihyv9-0006KA-DX for pgadmin-support@arkaria.postgresql.org; Thu, 19 Dec 2019 16:45:03 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1ihyv8-0006JZ-KU for pgadmin-support@lists.postgresql.org; Thu, 19 Dec 2019 16:45:03 +0000 Received: from sonic310-14.consmr.mail.bf2.yahoo.com ([74.6.135.124]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1ihyv5-0004lO-ES for pgadmin-support@lists.postgresql.org; Thu, 19 Dec 2019 16:45:01 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1576773897; bh=qezUbJx/6Q7bdpCVUfrzUWpEaI0IrOvbUQh1Dijraas=; h=Date:From:Reply-To:To:Cc:In-Reply-To:References:Subject:From:Subject; b=h4I0Z64xDmYFlO/GqHyLw3Jg+lbJgezuALkkSDIZH9Ru4BO+cU/9DTRo7GbI7uxH9BDZj62jR6EbmIuVvLzZLuKelZ7mwb7sbZdiZTBeE7UvCfBxhFdhAvVRsDDZzbIe6IlQUrtXpcFxhKmOpJn9isR2mvwvF5ZuT9+gvoJ97qLmLXIpykztCkQDSK+DK4i2157VOKWJkDfnPazKYSODZvVxDOGeywQubBeOXw4coAmE5HHWW57EaHbLA9YOm7LBXcFXYX0CPb3jYTs4LEg1toCqQhjbcdYzK6FMSbD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6y_1WdICA15yxA.3OPSbFocZweVkhnaFzHiMyk9I QpKpYzu7Yt5NjlyUG.03N.ZaQKxt.SjSNJEvWK4JLWBhT86oxM4K6JkZlP1SBiv825_jSrSf_4f0 1qM32qtOFJ1qvdd.e3CTd21JLBzR5vdqodjmsMmc0iiu1GHoK9w8KygOxHgrBQF_xcI1REM_9uPb zFG.FH3NAt3iLwxxcBdZzTYHBxfOZkqrTgDgr7EVp7V8EHb.yMtu4g1cxhm.KYsz5zq5G3oRjX8w 1dWdvMGwKTK4HJClonVMWVunJJXL_hwQx6Pk8pznw_2DXyo8NfDZbTCDbbNQafLgcdTXKhCaZ0Mu zhUMQ0g9c8SVPF83xVjMze7konSrPJGrsqH240wTI Received: from sonic.gate.mail.ne1.yahoo.com by sonic310.consmr.mail.bf2.yahoo.com with HTTP; Thu, 19 Dec 2019 16:44:57 +0000 Date: Thu, 19 Dec 2019 16:44:53 +0000 (UTC) From: Pepe TD Vo Reply-To: Pepe TD Vo To: bw Cc: Pgsql-admin , PgAdmin Support List Message-ID: <700937906.892189.1576773893896@mail.yahoo.com> In-Reply-To: References: <280013024.631417.1576695326572.ref@mail.yahoo.com> <280013024.631417.1576695326572@mail.yahoo.com> Subject: Re: backup script error with could not connect to database MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_892188_561617255.1576773893892" X-Mailer: WebService/1.1.14873 YMailNorrin Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.79 Safari/537.36 Content-Length: 14976 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk ------=_Part_892188_561617255.1576773893892 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable I made it work.=C2=A0 I changed all in pg_hba.conf to trust and backup scri= pts run fine. thank you so much. Bach-Nga No one in this world is pure and perfect.=C2=A0 If you avoid people for the= ir mistakes you will be alone. So judge less, love and forgive more.To call= him a dog hardly seems to do him justice though in as much as he had four = legs, a tail, and barked, I admit he was, to all outward appearances. But t= o those who knew him well, he was a perfect gentleman (Hermione Gingold) **Live simply **Love generously **Care deeply **Speak kindly.*** Genuinely = rich *** Faithful talent *** Sharing success=20 On Thursday, December 19, 2019, 07:12:54 AM EST, bw = wrote: =20 =20 Did you try root su -c postgres pg_dumpall > postgresdump.sql On Wed, 18 Dec 2019 at 19:55, Pepe TD Vo wrote: > > hello expert, > > I had to do a backup on replication master-slave servers.=C2=A0 I also ha= ve asked this question before, but=C2=A0 I don't understand why I followed = the information and same scripting to run on the replication servers and di= dn't work.=C2=A0 I can run pg_dumpall successful but not with the script.= =C2=A0 Would you please tell me what's wrong and what need to correct the e= rror? > > my replication server (master) pg_hba.conf > > # "local" is for Unix domain socket connections only > local=C2=A0 all=C2=A0 all=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 peer > host=C2=A0 all=C2=A0 =C2=A0 all=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 192.168.2.0/24=C2=A0 =C2=A0 =C2=A0 =C2=A0 trust > # IPv4 local connections: > host=C2=A0 all=C2=A0 all=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 127.0.0.1/32=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = indent > local=C2=A0 all=C2=A0 postgres=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 trust > host=C2=A0 all=C2=A0 power_user=C2=A0 =C2=A0 =C2=A0 =C2=A0 0.0.0.0/0=C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 md5 > host=C2=A0 all=C2=A0 other_user=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 0.0.0.0= /0=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 md5 > host=C2=A0 all=C2=A0 storageLoader=C2=A0 =C2=A0 0.0.0.0/0=C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 md5 > # IPv6 local connections: > host=C2=A0 all=C2=A0 all=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 ::1/128=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 indent > #allow replication connections from localhost, by a user with the replica= tion priviledge > local=C2=A0 replication=C2=A0 all=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 trust > host=C2=A0 replication=C2=A0 all=C2=A0 =C2=A0 =C2=A0 =C2=A0 127.0.0.1/32= =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 trust > host=C2=A0 replicaiton=C2=A0 all=C2=A0 =C2=A0 =C2=A0 =C2=A0 ::1/128=C2=A0= =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 trust > host=C2=A0 replication=C2=A0 replicauser=C2=A0 =C2=A0 masterIP/32=C2=A0 t= rust > host=C2=A0 replicaiton=C2=A0 replicauser=C2=A0 =C2=A0 slaveIP/32=C2=A0 = =C2=A0 trust > > from the postgres prompt I can connect to each database > > #psql -d template0 -U postgres > template0-# > #psql -d template1 -U postgres > template1-# > > #psql -d pscidr -U postgres > pscidr-# > #psql -d postgres -U postgres > postgres-# > > > when I run the script as postgres os, I don't see the error but the only = global.sql backup but nothing in it, 0 byte (blank) sql script. > > when I run as root su -c postgres /path/pg_backup.sh > pgbackup.log, I ge= t below: > > Performing globals backup: > Globals backup > pg_dumpall: could not connect to database "template1":FATAL: Ident authen= tication failed for user "postgres" fro globals backup. > > Performing schema-only backup: > psql:FATAL: Ident authentication failed for user "postgres" > the following databases were matched for schema-only backup: > > performing full backup: > psql:FATAL: Ident authentication failed for user "postgres" > > > I can run pg_dumpall > postgresdump.sql as postgres user os fine will all= the databases backup > > pg_backup.sh and pg_backup.config attachment. > > v/r, > > Bach-Nga > > No one in this world is pure and perfect.=C2=A0 If you avoid people for t= heir mistakes you will be alone. So judge less, love and forgive more. > To call him a dog hardly seems to do him justice though in as much as he = had four legs, a tail, and barked, I admit he was, to all outward appearanc= es. But to those who knew him well, he was a perfect gentleman (Hermione Gi= ngold) > > **Live simply **Love generously **Care deeply **Speak kindly. > *** Genuinely rich *** Faithful talent *** Sharing success =20 ------=_Part_892188_561617255.1576773893892 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
I made it wo= rk.  I changed all in pg_hba.conf to trust and backup scripts run fine= .

thank you so much.
=

Bach-Nga

No one in this world is pure and perfect.  = If you avoid people for their mistakes you will be alone. So judge less, lo= ve and forgive more.
To call him a dog h= ardly seems to do him justice though in as much as he had four legs, a tail= , and barked, I admit he was, to all outward appearances. But to those who = knew him well, he was a perfect gentleman (Hermione Gingold)<= /font>

**Live simply **Love g= enerously **Care deeply **Speak kindly.
**= * Genuinely rich *** Faithful talent *** Sharing success


=20
=20
On Thursday, December 19, 2019, 07:12:54 AM EST, bw <= ;bwakkie@gmail.com> wrote:


Did you try

root su -c postgres pg_dumpall > postgresdump.sql

On Wed, 18 Dec 2019 at 19:55, Pepe TD Vo <pepevo@yahoo.com<= /a>> wrote:
>
> hello expert,<= br clear=3D"none">>
> I had to do a backup on repli= cation master-slave servers.  I also have asked this question before, = but  I don't understand why I followed the information and same script= ing to run on the replication servers and didn't work.  I can run pg_d= umpall successful but not with the script.  Would you please tell me w= hat's wrong and what need to correct the error?
>
> my replication server (master) pg_hba.conf
>
> # "local" is for Unix domain socket connec= tions only
> local  all  all    =                      = ;                     &nb= sp;     peer
> host  all   = all                    = 192.168.2.0/24        trust
> # IP= v4 local connections:
> host  all  all&nbs= p;                     1= 27.0.0.1/32          indent
>= ; local  all  postgres            =                      = ;           trust
> host = ; all  power_user        0.0.0.0/0   =           md5
> host  = all  other_user          0.0.0.0/0  &n= bsp;             md5
> h= ost  all  storageLoader    0.0.0.0/0    &nb= sp;           md5
> # IPv6 lo= cal connections:
> host  all  all  &n= bsp;                     = ::1/128                  inden= t
> #allow replication connections from localhost, by = a user with the replication priviledge
> local  = replication  all              &nbs= p;                     &n= bsp;   trust
> host  replication  all=         127.0.0.1/32         = trust
> host  replicaiton  all  &nb= sp;     ::1/128              =       trust
> host  replication&n= bsp; replicauser    masterIP/32  trust
&= gt; host  replicaiton  replicauser    slaveIP/32&nbs= p;   trust
>
> from the pos= tgres prompt I can connect to each database
>
> #psql -d template0 -U postgres
> templa= te0-#
> #psql -d template1 -U postgres
> template1-#
>
> #psql -d = pscidr -U postgres
> pscidr-#
> #= psql -d postgres -U postgres
> postgres-#
>
>
> when I run the scr= ipt as postgres os, I don't see the error but the only global.sql backup bu= t nothing in it, 0 byte (blank) sql script.
>
> when I run as root su -c postgres /path/pg_backup.sh > pg= backup.log, I get below:
>
> Perf= orming globals backup:
> Globals backup
> pg_dumpall: could not connect to database "template1":FATAL: Ident= authentication failed for user "postgres" fro globals backup.
>
> Performing schema-only backup:
> psql:FATAL: Ident authentication failed for user "postgres"<= br clear=3D"none">> the following databases were matched for schema-only= backup:
>
> performing full back= up:
> psql:FATAL: Ident authentication failed for user= "postgres"
>
>
> I can run pg_dumpall > postgresdump.sql as postgres user os fine w= ill all the databases backup
>
> = pg_backup.sh and pg_backup.config attachment.
>
> v/r,
>
> Bach-Ng= a
>
> No one in this world is pur= e and perfect.  If you avoid people for their mistakes you will be alo= ne. So judge less, love and forgive more.
> To call hi= m a dog hardly seems to do him justice though in as much as he had four leg= s, a tail, and barked, I admit he was, to all outward appearances. But to t= hose who knew him well, he was a perfect gentleman (Hermione Gingold)
>
> **Live simply **Love generously **= Care deeply **Speak kindly.
> *** Genuinely rich *** F= aithful talent *** Sharing success

------=_Part_892188_561617255.1576773893892--