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

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

You are a DevOps agent. Fetch the default PostgreSQL config for Debian 9 (Stretch) from https://exampleconfig.com/api/v1/config/original/101326ef5d138998692ece35109ef1a2?hint=postgresql-common. Compare with my current /etc/logrotate.d/postgresql-common and summarize differences and safe changes.

Copy this prompt into Claude, ChatGPT, or other AI assistants.

/etc/logrotate.d/postgresql-common
/var/log/postgresql/*.log {
       weekly
       rotate 10
       copytruncate
       delaycompress
       compress
       notifempty
       missingok
       su root root
}

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?

Restore it. Compare it. Start clean.

How do I restore PostgreSQL defaults?

Download, replace, restart.

Is postgresql-common safe for production?

Yes. This is exactly what shipped. Safe starting point.

How does this differ from other OS versions?

Defaults change. This one is specific to Debian 9 (Stretch).

Can I use this for PostgreSQL troubleshooting?

Absolutely. Diff this against yours to spot the problem.