Subject: [pgjdbc/pgjdbc] PR #3961: fix: use compareTo for LogSequenceNumber comparison

From: "vlsi (@vlsi)" <[email-masked]>
Date: Fri, 13 Mar 2026 18:58:36 +0000

Previously, processKeepAliveMessage used asLong() for LogSequenceNumber comparison, however, it might produce wrong results since longs in Java are signed.

---

From: "vlsi (@vlsi)" <[email-masked]>
Date: Fri, 13 Mar 2026 19:00:36 +0000

(on pgjdbc/src/test/java/org/postgresql/replication/LogicalReplicationStatusTest.java:451)

This should fix flaky failures like

```
    Expected: not <LSN{0/100E8CD8}>
         but: was <LSN{0/100E8CD8}>
        at org.hamcrest.MatcherAssert.assertThat(MatcherAssert.java:20)
        at org.postgresql.replication.LogicalReplicationStatusTest.keepAliveServerLSNCanBeUsedToAdvanceFlushLSN
```

---

From: "davecramer (@davecramer)" <[email-masked]>
Date: Fri, 13 Mar 2026 19:26:49 +0000

nice