comparison Framework/PostgreSQL/PostgreSQLDatabase.cpp @ 429:dbf811b1bb43 pg-transactions

new configuration 'EnableVerboseLogs' to log SQL statements being executed
author Alain Mazy <am@osimis.io>
date Thu, 30 Nov 2023 14:47:23 +0100
parents a7f0f27fe33c
children f0976163dbe1
comparison
equal deleted inserted replaced
428:4d0bacbd0fba 429:dbf811b1bb43
157 } 157 }
158 158
159 159
160 void PostgreSQLDatabase::ExecuteMultiLines(const std::string& sql) 160 void PostgreSQLDatabase::ExecuteMultiLines(const std::string& sql)
161 { 161 {
162 LOG(TRACE) << "PostgreSQL: " << sql; 162 if (IsVerboseEnabled())
163 {
164 LOG(INFO) << "PostgreSQL: " << sql;
165 }
163 Open(); 166 Open();
164 167
165 PGresult* result = PQexec(reinterpret_cast<PGconn*>(pg_), sql.c_str()); 168 PGresult* result = PQexec(reinterpret_cast<PGconn*>(pg_), sql.c_str());
166 if (result == NULL) 169 if (result == NULL)
167 { 170 {