Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1vxR2f-00Dv3z-1q for pgsql-general@arkaria.postgresql.org; Tue, 03 Mar 2026 14:48:09 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1vxR2c-007LDL-2B for pgsql-general@arkaria.postgresql.org; Tue, 03 Mar 2026 14:48:07 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1vxR2c-007LDB-13 for pgsql-general@lists.postgresql.org; Tue, 03 Mar 2026 14:48:06 +0000 Received: from mail-wm1-x330.google.com ([2a00:1450:4864:20::330]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1vxR2a-00000000Csd-1HL1 for pgsql-general@lists.postgresql.org; Tue, 03 Mar 2026 14:48:06 +0000 Received: by mail-wm1-x330.google.com with SMTP id 5b1f17b1804b1-4806bf39419so49713105e9.1 for ; Tue, 03 Mar 2026 06:48:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cybertec.at; s=google; t=1772549283; x=1773154083; darn=lists.postgresql.org; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:to:from:subject:message-id:from:to:cc:subject:date :message-id:reply-to; bh=t8C876zl3KW7ghr4TTPAtP0ve2YrSarHqlLmdbKuoJU=; b=GyPyBFbma/RHPPdLVcYkZ+BcTID3lJ4Z0lUzZpMG7E4/uqjhYulb8/reSt2x2nAJ+3 6nlJ2z7svrmHuyOj7tC6mtQvm3A+5kKygQpTjnX2kuJbIel1k8qC0BihIc+MGs7QmCGq tq2yhoEk59Qgzud8aRCx+/WF8204n3EEWGOJ8gT+Wnfdm8SbruRLEzG4glYT7HaJYLY8 vrw5QLguro0D+BSZhcVVwI+WVrWqoR4egQTjSuNyJRzSZbwJVxa804rO8Ytiwv4eydIX x7+fEUjkuybup0KHxrO61dZSoDA6kQlfzTAH+W5/UJmEFIDSUcFEQ0oMK+9ejrI0fy8s 8RVg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1772549283; x=1773154083; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:to:from:subject:message-id:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=t8C876zl3KW7ghr4TTPAtP0ve2YrSarHqlLmdbKuoJU=; b=BAEbLYqU9a3E3Lgf1glzbHu8NdbKBx+nxU9FtPthCOh83BWl+agsh1N7POQd8knyCR 0z/RhmUgsD7NVr8upYR4Qzcc6o63cN7K5NoUCO/yM4gQDDDlB03/OaPhYohWPIxlAWRG w3FJWKb8i/YS/9e1tWTWNQUczSyTQ4uZNTh73pNQvdibi0erlfExyTFBYHcXhPsV3Hdf LePGnJNaeFA+/qIY/XWImseKgsGb5SHbSxr2Tizyszvuw8NMgXZcfmrR4J04K8ml+gxF 3X9vNxBLqG6SHIKVb3qXGlPcqGydK53Tpz+wu3lzF4pjFCKNv1mMjrSlQWdwoS0qjKBq 8bmQ== X-Forwarded-Encrypted: i=1; AJvYcCWtv3cqortNrNsOY5EY6iIh3DE9kEhi4IuNOzZGBB/TlG65aemlFEiEgd402aFoc3+0EeYQPtk98iQ+ryyZ@lists.postgresql.org X-Gm-Message-State: AOJu0YxpSgDo0VwlnSjuEedKjVv4HhjtRpA1S2jUTzUg6T48Csj0BeHe IXrmkzYGHzR1iJOZkQbrPlR2v8UthnWgFrcS2wJzr319RwfSoZiRu6RkskPCZ18tKHH1wAOYAhI PzuGH/EY= X-Gm-Gg: ATEYQzyVzC92bfJKNu0BD/un5VIKBOdrPKGANyhD3oJ3+KwsmNI9zt0JQVa8+u5RSdA ot1cg9UkTbcbHZUo3kNVfCXsZBWwV+Sev+ki5tZCucRaOQS1YOaNDJalsCxaa9XMVN9nKNiR3s4 7WLn7mXEMKORNeDY0u09ABe33ZvyNSC4xgGl/2PtRJvC1Cuyjj0RFvl2HIniBiGfDrQ428jeqzQ t3o1zL0pwMUgGXC3clftfCjX6tk4CKz5mDlCexV00KNCktDcqvb3atLqUL/4btHEsfyJpDVtHZr 9tYAIoR8y4IWDKcrllm+921DJnFns2GMW+bCEFIPBYpmBHolFyZHqLhRea/PCxskXjTlfkeiSwL uzMTYc3EjpHeXDrVY9tbi8L2G0EOp/a3Sg9R9rMVaHrE9zfdU4CSXx8C3g8qRaUMFZtqwIR7i9R ljX1cexegl67hkwMyWRZA1sj8MkjaxE8khqKFMJMZ5mK24Ao7pB5Cg X-Received: by 2002:a05:600c:6992:b0:47e:e981:78b4 with SMTP id 5b1f17b1804b1-48513c71087mr40023275e9.12.1772549282972; Tue, 03 Mar 2026 06:48:02 -0800 (PST) Received: from laurenz.albe-K4N0CV00F97414D ([2001:871:70:68a9:f22f:eefb:ae52:d37a]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-483c3b841absm396605875e9.13.2026.03.03.06.48.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 03 Mar 2026 06:48:02 -0800 (PST) Message-ID: <613e378c68d816e700a694f97d3a49b8afed7678.camel@cybertec.at> Subject: Re: PostgreSQL Archive Log Partition Reaching 95% =?UTF-8?Q?=E2=80=93?= Need Automated Cleanup From: Laurenz Albe To: loganathan P , pgsql-general@lists.postgresql.org Date: Tue, 03 Mar 2026 15:48:01 +0100 In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.58.3 (3.58.3-1.fc43) MIME-Version: 1.0 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Tue, 2026-03-03 at 19:51 +0530, loganathan P wrote: > We have PostgreSQL 15 and PostgreSQL 17 databases running in separate env= ironments on different servers. > Each database is approximately 1.5 TB in size and highly active, generati= ng around 500 GB of archive > logs per day. We have VM SRM replication configured. >=20 > The archive log partition reaches 95=E2=80=93100% utilization before back= ups are taken. After the backups are > completed, we must manually remove the archived log files to free up spac= e. >=20 > Could you please advise whether PostgreSQL has any built-in parameters or= mechanisms to automatically > delete archived log files once they have been successfully backed up? Since PostgreSQL doesn't know about your archives, there is no way for it t= o clean up automatically. You have to do that yourself. There is the "pg_archivecleanup" utility that you can use with the backup f= ile generated in the WAL archive: pg_archivecleanup /mnt/server/archivedir 000000010000000000000010.0000002= 0.backup The easiest way would be to use a backup software like pgBackRest that does= these things for you. Yours, Laurenz Albe