Getting ready

This recipe assumes that you have already set up replication according to the earlier recipes so that wal_level, max_wal_senders, and other parameters are set.

A replication slot represents one link between two nodes. At any time, each slot can support one connection. If you draw a diagram of your replication architecture, then each connecting line is one slot. Each slot must have a unique name. The slot name must contain only lowercase letters, numbers, and underscores.

As discussed previously, each node should have a unique name. So a suggestion would be to construct the slot name from the two node names that it links. For various reasons, there may be a need for multiple slots between two nodes, so additional information is also required for uniqueness. For two servers called alpha and beta, an example of a slot name would be alpha_beta_1.

For LSR, each slot refers to a single database rather than the whole server. In that case, slot names could also include database names.