From b125cd0df1d6c7a3776b14f3e701402753c79e93 Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Sun, 13 Jun 2021 14:05:34 +0100 Subject: Remember PQ connection string --- lib/output/pq/pqConn.cpp | 2 +- lib/output/pq/pqConn.h | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) (limited to 'lib/output') diff --git a/lib/output/pq/pqConn.cpp b/lib/output/pq/pqConn.cpp index c1a7362..309b704 100644 --- a/lib/output/pq/pqConn.cpp +++ b/lib/output/pq/pqConn.cpp @@ -15,7 +15,7 @@ namespace MyGrate::Output::Pq { { } - PqConn::PqConn(const char * const str) : conn {PQconnectdb(str), PQfinish} + PqConn::PqConn(const char * const str) : connstr {str}, conn {PQconnectdb(str), PQfinish} { verify(PQstatus(conn.get()) == CONNECTION_OK, "Connection failure", conn.get()); PQsetNoticeProcessor(conn.get(), notice_processor, this); diff --git a/lib/output/pq/pqConn.h b/lib/output/pq/pqConn.h index b8609ea..6db9bcf 100644 --- a/lib/output/pq/pqConn.h +++ b/lib/output/pq/pqConn.h @@ -32,6 +32,8 @@ namespace MyGrate::Output::Pq { DbPrepStmtPtr prepare(const char * const, std::size_t nParams) override; + const std::string connstr; + private: static void notice_processor(void *, const char *); virtual void notice_processor(const char *) const; -- cgit v1.2.3