diff --git a/model/lantern/lantern_resource.rb b/model/lantern/lantern_resource.rb index 9439a28cb..3cca21879 100644 --- a/model/lantern/lantern_resource.rb +++ b/model/lantern/lantern_resource.rb @@ -97,7 +97,7 @@ def create_logical_replication_slot(name) end def create_physical_replication_slot(name) - representative_server.run_query("SELECT lsn FROM pg_create_physical_replication_slot('#{name}');").chomp.strip + representative_server.run_query("SELECT lsn FROM pg_create_physical_replication_slot('#{name}', true);").chomp.strip end def delete_replication_slot(name) diff --git a/spec/model/lantern/lantern_resource_spec.rb b/spec/model/lantern/lantern_resource_spec.rb index 59ca2a53a..72b5c4e5b 100644 --- a/spec/model/lantern/lantern_resource_spec.rb +++ b/spec/model/lantern/lantern_resource_spec.rb @@ -180,7 +180,7 @@ it "creates new physical replication slot" do representative_server = instance_double(LanternServer) expect(lantern_resource).to receive(:representative_server).and_return(representative_server).at_least(:once) - expect(lantern_resource.representative_server).to receive(:run_query).with("SELECT lsn FROM pg_create_physical_replication_slot('test');").and_return("0/6002748 \n") + expect(lantern_resource.representative_server).to receive(:run_query).with("SELECT lsn FROM pg_create_physical_replication_slot('test', true);").and_return("0/6002748 \n") expect(lantern_resource.create_physical_replication_slot("test")).to eq("0/6002748") end end