From be913c0bdf2900783d416c611398a52b5f3cb991 Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Thu, 9 May 2019 20:39:50 +0100 Subject: Create hasUnloggedTables, like hasCopyToProgram --- libpqpp/pq-mock.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'libpqpp/pq-mock.cpp') diff --git a/libpqpp/pq-mock.cpp b/libpqpp/pq-mock.cpp index 499d839..f0e90ea 100644 --- a/libpqpp/pq-mock.cpp +++ b/libpqpp/pq-mock.cpp @@ -37,8 +37,7 @@ AdHocFormatter(MockSetUnlogged, "ALTER TABLE %?.%? SET UNLOGGED"); void Mock::SetTablesToUnlogged() const { - // v9.5 server required for unlogged tables - if (serverVersion < 90500) { + if (!hasUnloggedTables()) { return; } auto s = master->select(R"SQL( @@ -73,6 +72,13 @@ Mock::~Mock() Mock::DropDatabase(); } +bool +Mock::hasUnloggedTables() const +{ + // v9.5 server required for unlogged tables + return (serverVersion >= 90500); +} + bool Mock::hasCopyToProgram() const { -- cgit v1.2.3