From 34c0479cdfe6339cddd0f08df576b5b0babad5e3 Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Tue, 3 Jan 2017 14:43:28 +0000 Subject: Only set unlogged for mocked tables on server versions 9.5 and above --- libpqpp/pq-mock.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'libpqpp') diff --git a/libpqpp/pq-mock.cpp b/libpqpp/pq-mock.cpp index 97882ba..f2090a4 100644 --- a/libpqpp/pq-mock.cpp +++ b/libpqpp/pq-mock.cpp @@ -29,7 +29,8 @@ AdHocFormatter(MockSetUnlogged, "ALTER TABLE %?.%? SET UNLOGGED"); void Mock::SetTablesToUnlogged() const { - auto c = DB::ConnectionPtr(openConnection()); + auto c = ConnectionPtr(openConnection()); + if (c->serverVersion() < 90500) return; auto s = c->select(R"SQL( SELECT n.nspname, c.relname FROM pg_class c, pg_namespace n -- cgit v1.2.3