Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kmHBl-0005B8-Or for pgsql-admin@arkaria.postgresql.org; Mon, 07 Dec 2020 14:08:29 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1kmHBi-00018G-Gt for pgsql-admin@arkaria.postgresql.org; Mon, 07 Dec 2020 14:08:26 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kmHBi-000188-9T for pgsql-admin@lists.postgresql.org; Mon, 07 Dec 2020 14:08:26 +0000 Received: from mout.perfora.net ([74.208.4.197]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kmHBf-0006Wd-W1 for pgsql-admin@lists.postgresql.org; Mon, 07 Dec 2020 14:08:25 +0000 Received: from [192.168.1.165] ([72.205.30.64]) by mrelay.perfora.net (mreueus003 [74.208.5.2]) with ESMTPSA (Nemesis) id 0Lfl9w-1kNcYC2ePS-00pLTk; Mon, 07 Dec 2020 15:08:18 +0100 Subject: Re: Archive directory To: Scott Ribe Cc: Yambu , Ian Lawrence Barwick , Pgsql-admin References: <5AAB0FED-45AA-45F6-AFB5-A65A36275492@elevated-dev.com> From: MichaelDBA Message-ID: <5b4dcc9a-774c-8816-a8ac-b055bc340b60@sqlexec.com> Date: Mon, 7 Dec 2020 09:08:15 -0500 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 PostboxApp/7.0.40 MIME-Version: 1.0 In-Reply-To: <5AAB0FED-45AA-45F6-AFB5-A65A36275492@elevated-dev.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US X-Provags-ID: V03:K1:Gssbzz0RYRoC8/6fxeRzIQbr2VlP/5iKBI7sIhq9mYBqXnjYMkQ e3izH8L/2DyMjZ0TacN7ZGL+IeoGAn+j7GfxVV0koIHMmvwa4aJnYA4LSkKUonmPBGi3rQb Cya+H23vYLe0/OrsRwCEDhpOoRZvEVDGB/Gwufah3qmXk5Oh5sFqgyY9avRDhEAIwf1coFf +MusEYPMP3b7yk4w0Ni3A== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:lIXelSsIRzg=:v0Snuu/4uLavxDA/GPY23Z aJ/5dnrteBb1TSnk/2jMrU3eCPGYwus/twjjfOQcpSOwhsJPTTeGx24NKK2Dz13cD77mAMR3u d6qFtF+pg6BZDBYH6reRDvTyTc1S+tNFim5VFrmhfpGmAgVS+PlF4zQp+MiPQm8QhJ5UwttkG /GI0ZTCgy2ecxKgHcrdyPvH7FJoTOtiNIDabCnTRMyQoq+AW2RRPwAFRhsYYyo6aN3PmsEjG6 QEWKUnkzK3KvXOTw2Btwwzziim3ViLdQmM3LbTtu3qz+r42ZQiOJuHWBY8ZI+Q4UtlnXu/bvA K1DS/GsT6EdXdZ6nzULngB8LMsz3zxviChL6uo0K5fizbfkOXLqamJi0mayMNd6j7yCet53bU FIEUk/QZRspHRgJPkh6M2FgrKJ4/VvGFW8bMuvVUfqtHOHC5KvqSFmVAvWTnG3GPpEAc6ItOO 4WGFqT56jQ== List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk hmmm, I disagree with that statement: The point of the archive_command is to release WALs from the WAL directory that have already been applied to the actual data files during checkpoints, and send these archived WALs elsewhere, whether it be a replica, another location on the master, or to a backup server like Barman and pgbackrest.  The ultimate goal is to preserve point in time recovery. So postgres doesn't care where you send the WALs, but that you just did something with it so it can remove them from its own internal directory, pg_wal/pg_xlog.  So you can even do this: archive_command = '/bin/true' which actually does nothing but lets PG know it can remove that WAL from its WALDIR. Regards, Michael Vitale Scott Ribe wrote on 12/7/2020 8:53 AM: >> On Dec 7, 2020, at 6:47 AM, Yambu wrote: >> >> Does the command ,archive_cleanup_command, delete the files from the master server? i understand this config is done on the slave server > The point of the archive command is to copy to the replica. If you're archiving on master, then using some script to copy to replica, then postgres has no way to know when it is safe to delete WAL files. > > >