SLONIK_CLUSTER_NAME(7)

πŸ“¦
version 2.2.11 Β· 4 versions
, in debian trixie, ubuntu questing

✨ NAME ✨

CLUSTER NAME β€” the preamble, aka the lil intro that tells everyone which Slony-I cluster we're even talking about πŸŽ€


🌸 SYNOPSIS 🌸

CLUSTER NAME = [clustername;]

πŸ’– DESCRIPTION πŸ’–

Okay bestie, listen up, because this one is non-negotiable: CLUSTER NAME has to be the very first statement in every single slonik script. Like, first. Before anything else. No cap. πŸ™…β™€οΈ

What it does is define the namespace where all the Slony-I specific functions, procedures, tables and sequences live. The way the namespace name gets built is: it takes your string literal and slaps an underscore in front of it. So cute, so simple. 🫢

And here's the iconic part β€” that namespace is identical in every database that participates in the same replication group. Same name, everywhere, matching energy, periodt. πŸ‘‘

Some important tea though:

  • No user objects are supposed to live in this namespace. It's not yours, it's the cluster's. Respect the space. 🚫
  • The namespace is not allowed to exist prior to adding a database to the replication system. It literally cannot be there beforehand.
⚠️ So if you're adding a new node using pg_dump -s on a database that's already in the cluster of replicated databases, you're gonna need to drop the namespace first, with this SQL command: sql DROP SCHEMA _testcluster CASCADE; Don't skip this step, I'm begging. 😭

πŸ¦‹ EXAMPLE πŸ¦‹

CLUSTER NAME = testcluster;

Look at her. Ten out of ten. Flawless. πŸ’…


⭐ VERSION INFORMATION ⭐

This command was introduced in Slony-I 1.0. She's a legacy queen and she's been serving since day one. πŸ‘‘


Slony-I 2.2.11 Documentation πŸ’œ β€” that's the version and the docs this whole page came from, and it's dated 19 September 2024, so you know it's fresh-ish. Mwah, bye bestie, go name your cluster πŸ’–βœ¨πŸŽ€πŸ¦‹πŸŒΈ

πŸ“¦ where this page comes from