PostgreSQL /etc/postgresql/17/main/environment

Original 📋 Ubuntu 24.04 LTS (Noble Numbat) 7 lines

Works On

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

Details

Size
7 lines
MD5
a567730a646c4afdfc5cea58aa4bd49a
SHA256
1074010e46c5629825bdac2484052ddaec9b128e202c3861bc4d4f9c88cce9ec
/etc/postgresql/17/main/environment
# environment variables for postgres processes
# This file has the same syntax as postgresql.conf:
#  VARIABLE = simple_value
#  VARIABLE2 = 'any value!'
# I. e. you need to enclose any value which does not only consist of letters,
# numbers, and '-', '_', '.' in single quotes. Shell commands are not
# evaluated.

Copy & Paste

curl:
curl https://exampleconfig.com/api/v1/config/original/a567730a646c4afdfc5cea58aa4bd49a?hint=environment
wget:
wget -O environment https://exampleconfig.com/api/v1/config/original/a567730a646c4afdfc5cea58aa4bd49a?hint=environment

For AI Agents

<prompt><role>DevOps agent</role><source url='https://exampleconfig.com/api/v1/config/original/a567730a646c4afdfc5cea58aa4bd49a?hint=environment' /><config><app>PostgreSQL</app><os>Ubuntu 24.04 LTS (Noble Numbat)</os><location>/etc/postgresql/17/main/environment</location><lines>7</lines><md5>a567730a646c4afdfc5cea58aa4bd49a</md5><sha256>1074010e46c5629825bdac2484052ddaec9b128e202c3861bc4d4f9c88cce9ec</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/postgresql/17/main/environment
Directory
/etc/postgresql/17/main/
Significance
System-wide configuration directory
Description
Files in /etc/ contain system-wide configuration settings that affect all users.

FAQ

When should I use this environment?

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/postgresql/17/main/environment, replace it, then reload or restart PostgreSQL.

Is environment safe for production?

It is the vendor default for Ubuntu 24.04 LTS (Noble Numbat). 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 Ubuntu 24.04 LTS (Noble Numbat).

Can I use this for PostgreSQL troubleshooting?

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