// as this is the expected behavior.
// If it is a newer version, switch to legacy mode.
// as this is the expected behavior.
// If it is a newer version, switch to legacy mode.
// If the following calls fail, it is a legacy DB anyways, so it doesn't matter
// and no need to check the outcome.
db.exec("set standard_conforming_strings = off");
// If the following calls fail, it is a legacy DB anyways, so it doesn't matter
// and no need to check the outcome.
db.exec("set standard_conforming_strings = off");
if (query.lastError().isValid()) {
// We cannot enable standard conforming strings...
// since Quassel does no escaping by itself, this would yield a major vulnerability.
if (query.lastError().isValid()) {
// We cannot enable standard conforming strings...
// since Quassel does no escaping by itself, this would yield a major vulnerability.
// Set the PostgreSQL session timezone to UTC, since we want timestamps stored in UTC
QSqlQuery tzQuery = db.exec("SET timezone = 'UTC'");
if (tzQuery.lastError().isValid()) {
// Set the PostgreSQL session timezone to UTC, since we want timestamps stored in UTC
QSqlQuery tzQuery = db.exec("SET timezone = 'UTC'");
if (tzQuery.lastError().isValid()) {