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 1qEpiz-0005Xf-S7 for pgsql-admin@arkaria.postgresql.org; Thu, 29 Jun 2023 11:22:09 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1qEpiy-0007zj-Gu for pgsql-admin@arkaria.postgresql.org; Thu, 29 Jun 2023 11:22:08 +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 1qEpiy-0007zZ-5w for pgsql-admin@lists.postgresql.org; Thu, 29 Jun 2023 11:22:08 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qEpiv-0019ZI-Jn for pgsql-admin@lists.postgresql.org; Thu, 29 Jun 2023 11:22:07 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 35TBM1Qb1424082; Thu, 29 Jun 2023 07:22:02 -0400 From: Tom Lane To: Guillaume Lelarge cc: Nikhil Ingale , pgsql-admin@lists.postgresql.org Subject: Re: Deleting the pg logs older than 30 days or certain time In-reply-to: References: Comments: In-reply-to Guillaume Lelarge message dated "Thu, 29 Jun 2023 09:46:54 +0200" MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-ID: <1424080.1688037721.1@sss.pgh.pa.us> Content-Transfer-Encoding: 8bit Date: Thu, 29 Jun 2023 07:22:01 -0400 Message-ID: <1424081.1688037721@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Guillaume Lelarge writes: > Le jeu. 29 juin 2023 à 09:13, Nikhil Ingale a écrit : >> Can postgresql internal log rotation configuration mechanism delete the >> log files older than a specific period of time? > No. It will work if you choose a filename pattern such that old files are overwritten on some cycle. logrotate is a more flexible answer of course. regards, tom lane