1 Answer
- Newest
- Most votes
- Most comments
0
The problem was that I was using the wrong connection. I had a HikariCP, and thought I could just take one of the connections from it.
But what you need to do, is to create a specific 'replication' connection. Something like:
Properties props = new Properties();
PGProperty.USER.set(props, "user");
PGProperty.PASSWORD.set(props, "pass");
PGProperty.ASSUME_MIN_SERVER_VERSION.set(props, "9.4");
PGProperty.REPLICATION.set(props, "database");
PGProperty.PREFER_QUERY_MODE.set(props, "simple");
Connection con = DriverManager.getConnection(url, props);
