PostgreSQL /etc/systemd/postgresql.service

Original 📋 Debian 13 (Trixie) 18 lines

Works On

Viewing:
Debian 13 (Trixie)
Same on:
Debian 11 (Bullseye) Debian 12 (Bookworm) Ubuntu 20.04 LTS (Focal Fossa) Ubuntu 22.04 LTS (Jammy Jellyfish) Ubuntu 24.04 LTS (Noble Numbat)
Other versions:

Details

Size
18 lines
MD5
cc942563c4eedf643d245720ad57f7e5
SHA256
3670a6eba171d9402075bb0a56a0a52cf2f5be652b43486db744defa7cdb0be3
/etc/systemd/postgresql.service
# postgresql.service is the meta unit for managing all PostgreSQL clusters on
# the system at once. Conceptually, this unit is more like a systemd target,
# but we are using a service since targets cannot be reloaded.
#
# The unit actually managing PostgreSQL clusters is postgresql@.service,
# instantiated as postgresql@15-main.service for individual clusters.

[Unit]
Description=PostgreSQL RDBMS

[Service]
Type=oneshot
ExecStart=/bin/true
ExecReload=/bin/true
RemainAfterExit=on

[Install]
WantedBy=multi-user.target

Copy & Paste

curl:
curl https://exampleconfig.com/api/v1/config/original/cc942563c4eedf643d245720ad57f7e5?hint=postgresql.service
wget:
wget -O postgresql.service https://exampleconfig.com/api/v1/config/original/cc942563c4eedf643d245720ad57f7e5?hint=postgresql.service

For AI Agents

<prompt><role>DevOps agent</role><source url='https://exampleconfig.com/api/v1/config/original/cc942563c4eedf643d245720ad57f7e5?hint=postgresql.service' /><config><app>PostgreSQL</app><os>Debian 13 (Trixie)</os><location>/etc/systemd/postgresql.service</location><lines>18</lines><md5>cc942563c4eedf643d245720ad57f7e5</md5><sha256>3670a6eba171d9402075bb0a56a0a52cf2f5be652b43486db744defa7cdb0be3</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/systemd/postgresql.service
Directory
/etc/systemd/
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.service?

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/systemd/postgresql.service, replace it, then reload or restart PostgreSQL.

Is postgresql.service safe for production?

It is the vendor default for Debian 13 (Trixie). 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 13 (Trixie).

Can I use this for PostgreSQL troubleshooting?

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