summaryrefslogtreecommitdiff
path: root/libpqpp
diff options
context:
space:
mode:
authorDan Goodliffe <daniel.goodliffe@pressassociation.com>2017-01-03 14:43:28 +0000
committerDan Goodliffe <daniel.goodliffe@pressassociation.com>2017-01-03 15:16:50 +0000
commit450d4b684e35dcaa039c95f75d4077ad807c7ea5 (patch)
tree74b84d3c16c47e580ab1e005572fc373da4b87fb /libpqpp
parentCo-variant return of PQ connection from PQ mock (diff)
downloadlibdbpp-postgresql-450d4b684e35dcaa039c95f75d4077ad807c7ea5.tar.bz2
libdbpp-postgresql-450d4b684e35dcaa039c95f75d4077ad807c7ea5.tar.xz
libdbpp-postgresql-450d4b684e35dcaa039c95f75d4077ad807c7ea5.zip
Only set unlogged for mocked tables on server versions 9.5 and above
Diffstat (limited to 'libpqpp')
-rw-r--r--libpqpp/pq-mock.cpp3
1 files changed, 2 insertions, 1 deletions
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