POSTGRESQL-SETUP(1)

πŸ’– POSTGRESQL-SETUP(1) πŸ’–

okay bestie, welcome to the postgresql-setup manual page, section 1 of the user commands, brought to you by postgresql-setup version 8.12 ✨ this is the girlies' guide to not tanking your database cluster, and I'm gonna hold your hand through every single flag, no cap 🫢


🌸 SYNOPSIS 🌸

postgresql-setup MODE_OPTION [--unit=UNIT_NAME] [OPTION...]

πŸŽ€ DESCRIPTION πŸŽ€

So this script? It's literally built to help sysadmins with basic database cluster administration πŸ’… it's giving "your cool older cousin who knows bash". Most of the time you're not gonna need anything fancy β€” postgresql-setup --initdb and postgresql-setup --upgrade is enough, periodt. But there are other options, and yes we're describing every single one of them below because that's the vibe 🌈

If you want more info and the whole how/when to use this script situation, go read the documentation file at /usr/share/doc/postgresql18/README.rpm-dist πŸ“– iykyk.

✨ Available operation mode: ✨

  • --initdb β€” Initialize a new PostgreSQL database cluster 🐣 this is usually the very first action you perform after installing the PostgreSQL server. First day of school energy fr.
  • --upgrade β€” Upgrade your database cluster for a new major version of the PostgreSQL server πŸ¦‹ check out the --upgrade-from option for more info, she's got the details.

πŸ‘‘ OPTIONS πŸ‘‘

  • --unit=UNIT_NAME β€” The UNIT_NAME is used to select the proper unit configuration (and yes, "unit" == service or initscript name on non-systemd systems, we're inclusive here). For example, if you want to work with a unit called postgresql@com_example.service, you should pass postgresql@com_example β€” without the trailing .service string, bestie, don't leave it on. When no UNIT_NAME is explicitly passed, the postgresql string is used by default πŸ’–
  • --port=PORT β€” the port where the initialized server will listen for connections πŸ“‘
  • --datadir β€” Override the automatic detection of the PostgreSQL data directory. Heads up though: if your system is using systemd as its init system, it is advisable to change the data directory path in the service file instead 🫢 (do it the systemd way, she said so).
  • --upgrade-from-unit=UNIT β€” Select the proper unit name to upgrade from. This has similar semantics as the --unit option πŸ” same energy, different direction.
  • --upgrade-ids β€” Print the list of available IDs of upgrade scenarios to standard output πŸ“ so you can see what your options are.
  • --upgrade-from=ID β€” Specify the id of the "old" postgresql stack to upgrade from. You can list the available IDs with --upgrade-ids. Default is postgresql ⭐
  • --data-checksums β€” Enable data checksums for the data directory. And if you're upgrading? They will be enabled before performing the upgrade πŸ”₯ safety first, always.

πŸ’… Other options: πŸ’…

  • --help β€” show this help πŸ™‹
  • --version β€” show the version of this package 🏷️
  • --debug β€” show basic debugging information πŸ”

πŸ¦‹ ENVIRONMENT πŸ¦‹

  • PGSETUP_INITDB_OPTIONS β€” Options carried by this variable are passed to the subsequent call of the initdb binary (peep man initdb(1) for that one). This variable is used also during 'upgrade' mode, because the new cluster is actually re-initialized from the old one πŸŒ€ yep, that's the twist.
  • PGSETUP_PGUPGRADE_OPTIONS β€” Options in this variable are passed next to the subsequent call of pg_upgrade. For more info about possible options, please look at man pg_upgrade(1) πŸ“š
  • PGSETUP_DEBUG β€” Set this to '1' if you want to see very verbose shell debugging output 😭 it's a lot. it's so much. but it's there if you need it.
🌟 little note that lives down here: this was Built against PostgreSQL version 18.6.

🌈 SEE YOU LATER, BESTIE 🌈

That's the whole page! This cutie is postgresql-setup version 8.12, and the page itself is dated August 2026 β€” so go init that cluster, go upgrade that cluster, and remember: checksums before upgrade, .service never in your unit name, and always read the README.rpm-dist πŸ’œ mwah, bye! πŸŽ€βœ¨

πŸ“¦ where this page comes from