PostgreSQL /etc/logrotate.d/postgresql-common

Original 📋 Debian 9 (Stretch) 10 lines

Works On

Viewing:
Debian 9 (Stretch)
Same on:
Debian 10 (Buster) Debian 11 (Bullseye) Debian 12 (Bookworm) Debian 13 (Trixie) Ubuntu 18.04 LTS (Bionic Beaver) Ubuntu 20.04 LTS (Focal Fossa) Ubuntu 22.04 LTS (Jammy Jellyfish) Ubuntu 24.04 LTS (Noble Numbat)
Other versions:

Details

Size
10 lines
MD5
101326ef5d138998692ece35109ef1a2
SHA256
d79d7ccfd06bc621bdf50d608c68d0e3fed70bf8f3ce9e87bbbb2b1802fd3912
/etc/logrotate.d/postgresql-common
/var/log/postgresql/*.log {
       weekly
       rotate 10
       copytruncate
       delaycompress
       compress
       notifempty
       missingok
       su root root
}

Copy & Paste

curl:
curl https://exampleconfig.com/api/v1/config/original/101326ef5d138998692ece35109ef1a2?hint=postgresql-common
wget:
wget -O postgresql-common https://exampleconfig.com/api/v1/config/original/101326ef5d138998692ece35109ef1a2?hint=postgresql-common

For AI Agents

<prompt><role>DevOps agent</role><source url='https://exampleconfig.com/api/v1/config/original/101326ef5d138998692ece35109ef1a2?hint=postgresql-common' /><config><app>PostgreSQL</app><os>Debian 9 (Stretch)</os><location>/etc/logrotate.d/postgresql-common</location><lines>10</lines><md5>101326ef5d138998692ece35109ef1a2</md5><sha256>d79d7ccfd06bc621bdf50d608c68d0e3fed70bf8f3ce9e87bbbb2b1802fd3912</sha256></config></prompt>

Paste into Claude, ChatGPT, or any AI assistant.

Install PostgreSQL

Alpine Linux

sudo apk add postgresql

Debian

sudo apt update && sudo apt install postgresql

Red Hat Enterprise Linux

sudo yum install postgresql17-server

Ubuntu

sudo apt update && sudo apt install postgresql

File Location

File Path
/etc/logrotate.d/postgresql-common
Directory
/etc/logrotate.d/
Significance
System-wide configuration directory
Description
Files in /etc/ contain system-wide configuration settings that affect all users.

FAQ

When should I use this postgresql-common?

Use it to restore a missing default, confirm what shipped, or diff against your current PostgreSQL config.

How do I restore PostgreSQL defaults?

Download the file, back up the current one in /etc/logrotate.d/postgresql-common, replace it, then reload or restart PostgreSQL.

Is postgresql-common safe for production?

It is the vendor default for Debian 9 (Stretch). Treat it as a baseline and review security and performance settings before production use.

How does this differ from other OS versions?

Defaults vary by distro and version. This copy matches Debian 9 (Stretch).

Can I use this for PostgreSQL troubleshooting?

Yes. Diff it against yours to find drift, then restore only the sections you need.