@Override public int getDatabaseMajorVersion() throws SQLException { return connection.getServerMajorVersion(); }
private boolean useTemporarySlot() throws SQLException { return dropSlotOnClose && pgConnection().getServerMajorVersion() >= 10; }
@Test @FixFor("DBZ-934") public void temporaryReplicationSlotsShouldGetDroppedAutomatically() throws Exception { try(ReplicationConnection replicationConnection = TestHelper.createForReplication("test", true)) { PgConnection pgConnection = getUnderlyingConnection(replicationConnection); // temporary replication slots are not supported by Postgres < 10 if (pgConnection.getServerMajorVersion() < 10) { return; } // simulate ungraceful shutdown by closing underlying database connection pgConnection.close(); try (PostgresConnection connection = TestHelper.create()) { assertFalse("postgres did not drop replication slot", connection.dropReplicationSlot("test")); } } }
private boolean useTemporarySlot() throws SQLException { return dropSlotOnClose && pgConnection().getServerMajorVersion() >= 10; }
@Test @FixFor("DBZ-934") public void temporaryReplicationSlotsShouldGetDroppedAutomatically() throws Exception { try(ReplicationConnection replicationConnection = TestHelper.createForReplication("test", true)) { PgConnection pgConnection = getUnderlyingConnection(replicationConnection); // temporary replication slots are not supported by Postgres < 10 if (pgConnection.getServerMajorVersion() < 10) { return; } // simulate ungraceful shutdown by closing underlying database connection pgConnection.close(); try (PostgresConnection connection = TestHelper.create()) { assertFalse("postgres did not drop replication slot", connection.dropReplicationSlot("test")); } } }