SLONIK_SET_MOVE_TABLE(7)

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

πŸ’– SLONIK_SET_MOVE_TABLE πŸ’–

okay bestie, welcome to the SLONIK_SET_MOVE_TABLE(7) page β€” this one lives in the Slony-I 2.2.11 documentation, and it's literally just about yeeting a table from one replication set into another πŸ¦‹


✨ NAME ✨

SET MOVE TABLE β€” move a table from one Slony-I replication set to another 🌈


✨ SYNOPSIS ✨

SET MOVE TABLE (options);

✨ DESCRIPTION ✨

So the whole vibe here is: you're changing which set a table belongs to. That's it. That's the plot πŸ’…

But there's a catch, bestie, and it's a real one β€” the current set and the new set must origin on the same node and subscribed by the same nodes. No cap.

⚠️ Caution ⚠️ β€” and listen, this is the important part, don't skip it 😭 Because of the way subscribing to new sets works, make absolutely sure that the subscription of all nodes to the sets is completely processed before moving tables. If you move a table too early to a new set, the subscriber will try and add the table already during the subscription process, which fails with a duplicate key error and breaks replication. πŸ’€ So like... wait. Please wait. Fr fr.

Here are the options, one by one, no skipping:

  • ORIGIN = ival β€” the current origin of the set. And listen, a future version of slonik might figure out this information by itself, but for now you're telling it πŸ‘‘
  • ID = ival β€” the unique ID of the table. Iconic little number, very important.
  • NEW SET = ival β€” the unique ID of the set to which the table should be added. Where the table is going πŸŽ€

Under the hood this uses schemadocsetmovetable(p_new_set_id integer, p_tab_id integer) [not available as a man page]. So you can't go read that one, sorry bestie πŸ™ˆ


✨ EXAMPLE ✨

here's what it actually looks like in the wild, copy-paste energy:

SET MOVE TABLE (
    ORIGIN = 1,
    ID = 20,
    NEW SET = 3
);

✨ LOCKING BEHAVIOUR ✨

No application-visible locking should take place. 🧚 Like, none. Zero. The apps won't even notice you were there.


✨ SLONIK EVENT CONFIRMATION BEHAVIOUR ✨

Slonik waits for the command submitted to the previous event node to be confirmed on the specified event node before submitting this command. So it's out here being patient and responsible, which honestly? We love that for it 🫢


✨ VERSION INFORMATION ✨

This command was introduced in Slony-I 1.0.5 ⭐ β€” an elder. A legend. Been holding it down since way back.


and that's the whole page, bestie!! 🌸 this was the Slony-I 2.2.11 documentation, dated 19 September 2024 β€” go forth and move your tables responsibly, and for the love of everything, wait for those subscriptions to finish first πŸ’–βœ¨πŸ‘‘

πŸ“¦ where this page comes from