SLONIK_CLUSTER_NAME(7)
β¨ 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 usingpg_dump -son 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
- debian trixie: slony1-2-doc 2.2.11-6
- ubuntu questing: slony1-2-doc 2.2.11-6
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms