SLONIK_SET_ADD_SEQUENCE(7)
π NAME π
SET ADD SEQUENCE β bestie, this is the Slonik command that adds a sequence to a Slony-I replication set. That's it, that's the whole job. β¨
This page lives in the Slony-I 2.2.11 Documentation collection, and it's giving very much "here's how you get a sequence into the club." π
πΈ SYNOPSIS πΈ
SET ADD SEQUENCE (options);
β¨ DESCRIPTION β¨
Okay so real talk: this command takes an existing user sequence and adds it to a replication set. Lowkey the one catch β the set can't currently be subscribed by any other node. That whole "already got subscribers" situation? That's handled by the SLONIK MERGE SET(7) command instead. Different tool, different vibe. π
Now let's meet the options, because there are several and they all matter:
SET ID = ivalβ the ID of the set that the sequence is getting added to.ORIGIN = ivalβ the origin node for the set. This one is optional, iykyk.ID = ivalβ the unique ID of the sequence.
Heads up bestie: this ID needs to be unique across sequences throughout the cluster. The numbering of tables is separate, so you could have a table with ID 20 and a sequence with ID 20 and they'd be recognized as totally separate entities. No cap, they do not collide. π«Ά
- This parameter is optional. If this parameter is omitted then
slonikwill check every node that it can connect to and find the highest table id being used across all nodes. FULLY QUALIFIED NAME = 'string'β the full sequence name, schema name included. IfSEQUENCESis specified thenFULLY QUALIFIED NAMEshould be omitted. Pick a lane, babe. πSEQUENCES = 'string'β a POSIX regular expression that matches the sequences that should be added to the replication set. This regular expression is passed to postgresql for evaluation on the set origin against fully qualified sequence names. This parameter is optional. IfFULLY QUALIFIED NAMEis omitted thenSEQUENCESmust be specified.COMMENT = 'string'β a descriptive text added to the sequence entry. Give it a lil caption, she deserves one. π
Under the hood this uses schemadocsetaddsequence(p_seq_comment integer, p_fqname integer, p_seq_id text, p_set_id text) [not available as a man page]. Iconic function signature, honestly. π
π¦ EXAMPLE π¦
Here's the fully-specified era:
SET ADD SEQUENCE (
SET ID = 1,
ORIGIN = 1,
ID = 20,
FULLY QUALIFIED NAME = 'public.tracker_ticket_id_seq',
COMMENT = 'Support ticket ID sequence'
);
or, the regex girlies' route:
SET ADD SEQUENCE(
SET ID=1,
SEQUENCES='public\\.tracker_ticket_id_seq'
);
π LOCKING BEHAVIOUR π
No application-visible locking should take place. Zero drama, zero locks, we love a chill command. π
β³ 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. She's patient. She's polite. She waits her turn. π
β VERSION INFORMATION β
This command was introduced in Slony-I 1.0 β an elder, a legend, a founding mother. π
And that's the whole page, bestie! This was Slony-I 2.2.11 Documentation, dated 19 September 2024 β go forth and replicate those sequences responsibly. Mwah. π β¨π
π¦ 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