According to the documentation, restart_lsn is

The address (LSN) of oldest WAL which still might be required by the consumer of this slot and thus won't be automatically removed during checkpoints...

This is not very clear. The oldest LSN required by the consumer should be confirm_flush, because that is the point upto which the client has seen the data in a durable way. So my questions are

  • How is restart_lsn initialized?
  • When is it updated? and with what value?
  • How is it used?

1 Answer 1


This is what I understand from the source code. Although server can discard records older than flush_lsn, in practice, pgoutput needs record older than flush_lsn to perform the logical decoding. i.e., to translate physical changes to logical changes. These older records are related to schema changes. Thus, usually restart_lsn < flush_lsn and restart_lsn is the minimum lsn required to perform logical decoding.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.