pg.ddx.io pgsql-admin@postgresql.org mailing list archive
help / color / mirror / Atom feedDeleting the pg logs older than 30 days or certain time
5+ messages / 5 participants
[nested] [flat]
* Deleting the pg logs older than 30 days or certain time
@ 2023-06-29 07:12 Nikhil Ingale <niks.bgm@gmail.com>
2023-06-29 07:46 ` Re: Deleting the pg logs older than 30 days or certain time Guillaume Lelarge <guillaume@lelarge.info>
2023-06-29 17:45 ` Deleting the pg logs older than 30 days or certain time Wetmore, Matthew (CTR) <Matthew.Wetmore@express-scripts.com>
0 siblings, 2 replies; 5+ messages in thread
From: Nikhil Ingale @ 2023-06-29 07:12 UTC (permalink / raw)
To: pgsql-admin@lists.postgresql.org
Hi All,
Can postgresql internal log rotation configuration mechanism delete the log
files older than a specific period of time?
Is there a way to configure this as part of postgresql?
Regards,
Nikhil Ingale
^ permalink raw reply [nested|flat] 5+ messages in thread
* Re: Deleting the pg logs older than 30 days or certain time
2023-06-29 07:12 Deleting the pg logs older than 30 days or certain time Nikhil Ingale <niks.bgm@gmail.com>
@ 2023-06-29 07:46 ` Guillaume Lelarge <guillaume@lelarge.info>
2023-06-29 11:22 ` Re: Deleting the pg logs older than 30 days or certain time Tom Lane <tgl@sss.pgh.pa.us>
1 sibling, 1 reply; 5+ messages in thread
From: Guillaume Lelarge @ 2023-06-29 07:46 UTC (permalink / raw)
To: Nikhil Ingale <niks.bgm@gmail.com>; +Cc: pgsql-admin@lists.postgresql.org
Hi,
Le jeu. 29 juin 2023 à 09:13, Nikhil Ingale <niks.bgm@gmail.com> a écrit :
> Hi All,
> Can postgresql internal log rotation configuration mechanism delete the
> log files older than a specific period of time?
>
>
No.
> Is there a way to configure this as part of postgresql?
>
>
Nope, you'll have to configure logrotate.
--
Guillaume.
^ permalink raw reply [nested|flat] 5+ messages in thread
* Re: Deleting the pg logs older than 30 days or certain time
2023-06-29 07:12 Deleting the pg logs older than 30 days or certain time Nikhil Ingale <niks.bgm@gmail.com>
2023-06-29 07:46 ` Re: Deleting the pg logs older than 30 days or certain time Guillaume Lelarge <guillaume@lelarge.info>
@ 2023-06-29 11:22 ` Tom Lane <tgl@sss.pgh.pa.us>
2023-06-29 13:16 ` Re: Deleting the pg logs older than 30 days or certain time MichaelDBA <MichaelDBA@sqlexec.com>
0 siblings, 1 reply; 5+ messages in thread
From: Tom Lane @ 2023-06-29 11:22 UTC (permalink / raw)
To: Guillaume Lelarge <guillaume@lelarge.info>; +Cc: Nikhil Ingale <niks.bgm@gmail.com>; pgsql-admin@lists.postgresql.org
Guillaume Lelarge <guillaume@lelarge.info> writes:
> Le jeu. 29 juin 2023 à 09:13, Nikhil Ingale <niks.bgm@gmail.com> 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
^ permalink raw reply [nested|flat] 5+ messages in thread
* Re: Deleting the pg logs older than 30 days or certain time
2023-06-29 07:12 Deleting the pg logs older than 30 days or certain time Nikhil Ingale <niks.bgm@gmail.com>
2023-06-29 07:46 ` Re: Deleting the pg logs older than 30 days or certain time Guillaume Lelarge <guillaume@lelarge.info>
2023-06-29 11:22 ` Re: Deleting the pg logs older than 30 days or certain time Tom Lane <tgl@sss.pgh.pa.us>
@ 2023-06-29 13:16 ` MichaelDBA <MichaelDBA@sqlexec.com>
0 siblings, 0 replies; 5+ messages in thread
From: MichaelDBA @ 2023-06-29 13:16 UTC (permalink / raw)
To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: Guillaume Lelarge <guillaume@lelarge.info>; Nikhil Ingale <niks.bgm@gmail.com>; pgsql-admin@lists.postgresql.org
example: log_filename = 'postgresql-%a.log'
Tom Lane wrote on 6/29/2023 7:22 AM:
> Guillaume Lelarge <guillaume@lelarge.info> writes:
>> Le jeu. 29 juin 2023 à 09:13, Nikhil Ingale <niks.bgm@gmail.com> 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
>
>
Regards,
Michael Vitale
Michaeldba@sqlexec.com <mailto:michaelvitale@sqlexec.com>
703-600-9343
Attachments:
[image/jpeg] pgadvanced3.jpg (20.6K, ../../017a8f0f-2a35-297e-764e-5f77a1af4ff3@sqlexec.com/3-pgadvanced3.jpg)
download | view image
^ permalink raw reply [nested|flat] 5+ messages in thread
* Deleting the pg logs older than 30 days or certain time
2023-06-29 07:12 Deleting the pg logs older than 30 days or certain time Nikhil Ingale <niks.bgm@gmail.com>
@ 2023-06-29 17:45 ` Wetmore, Matthew (CTR) <Matthew.Wetmore@express-scripts.com>
1 sibling, 0 replies; 5+ messages in thread
From: Wetmore, Matthew (CTR) @ 2023-06-29 17:45 UTC (permalink / raw)
To: Nikhil Ingale <niks.bgm@gmail.com>; pgsql-admin@lists.postgresql.org <pgsql-admin@lists.postgresql.org>
I feel you have more control with a simple bash (or script of choice) one liner and cron. I don’t like automated deletes of anything unless I’m in control. $0.02
From: Nikhil Ingale <niks.bgm@gmail.com>
Sent: Thursday, June 29, 2023 12:12 AM
To: pgsql-admin@lists.postgresql.org
Subject: [EXTERNAL] Deleting the pg logs older than 30 days or certain time
Hi All,
Can postgresql internal log rotation configuration mechanism delete the log files older than a specific period of time?
Is there a way to configure this as part of postgresql?
Regards,
Nikhil Ingale
^ permalink raw reply [nested|flat] 5+ messages in thread
end of thread, other threads:[~2023-06-29 17:45 UTC | newest]
Thread overview: 5+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2023-06-29 07:12 Deleting the pg logs older than 30 days or certain time Nikhil Ingale <niks.bgm@gmail.com>
2023-06-29 07:46 ` Guillaume Lelarge <guillaume@lelarge.info>
2023-06-29 11:22 ` Tom Lane <tgl@sss.pgh.pa.us>
2023-06-29 13:16 ` MichaelDBA <MichaelDBA@sqlexec.com>
2023-06-29 17:45 ` Wetmore, Matthew (CTR) <Matthew.Wetmore@express-scripts.com>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox