SLONIK_CREATE_SET(7)

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

✨ NAME ✨

CREATE SET β€” bestie, this is the Slony-I command that creates a replication set πŸ’– (that's slonik_create_set(7) in the Slony-I 2.2.11 docs, iykyk)


🌸 SYNOPSIS 🌸

CREATE SET (options);

πŸŽ€ DESCRIPTION πŸŽ€

Okay so in the Slony-I replication system, your replicated tables don't just float around being chaotic β€” they're organized into sets. πŸ—‚οΈ

General rule of thumb, no cap: a set should contain all the tables of one application that have relationships with each other. And in a well-designed application? That's literally just all the tables in one schema. Clean, iconic, one vibe. ✨

The smallest unit one node can subscribe for replication from another node is a set. Every set always has an origin. In classical replication terms, that would be the 'master.' πŸ‘‘

But here's the thing β€” since in Slony-I a node can be the 'master' over one set while simultaneously receiving replication data in the 'slave' role for another set, that old terminology gets misleading real fast. πŸ™ˆ So we replaced it, bestie: say 'set origin' and 'subscriber' instead. Periodt.

πŸ’… the options

  • ID = ival β€” the ID of the set you're creating. That's it, that's the whole thing.
  • ORIGIN = ival β€” the initial origin node of the set. Like, where it all begins.
  • COMMENT = 'string' β€” a descriptive text that gets added to the set entry. Give it some personality!

If you don't provide one, a default value is set, and the default is literally: "A replication set so boring no one thought to give it a name." πŸ’€ Not me getting called out by my own database.

This uses schemadocstoreset(p_set_comment integer, p_set_id text) [not available as a man page]. So like, that's the function under the hood β€” you can't look it up as a man page, so don't go hunting for one. 🫢

πŸ¦‹ EXAMPLE πŸ¦‹

CREATE SET ( ID = 1,
          ORIGIN = 1,
          COMMENT = 'Tables for ticketing system' );

πŸ”’ LOCKING BEHAVIOUR πŸ”’

No application-visible locking should take place. Zero. None. Your app doesn't even notice. Slay. ✨


🧚 SLONIK EVENT CONFIRMATION BEHAVIOUR 🧚

Slonik waits for the command submitted to the previous event node to be confirmed on the specified event node before it submits this command. Patience is a virtue, okay?

Slonik will also wait until any outstanding DROP SET commands are confirmed by all nodes before it submits the CREATE SET command. It's not letting anything get messy on its watch. πŸ‘‘


⭐ VERSION INFORMATION ⭐

  • This command was introduced in Slony-I 1.0.
  • Until version 1.2, it would crash if no comment was provided. 😭 Not the glow-up we deserved but the glow-up we got.

And that's the whole page, bestie! This one's from the <strong>Slony-I 2.2.11</strong> docs, dated <strong>19 September 2024</strong>. Go forth and create your sets with main character energy. πŸ’œπŸ¦‹πŸŽ€

πŸ“¦ where this page comes from