Michael Uleysky 5 months ago
parent
commit
815ae6b4dd
  1. 9
      include/cache.h

9
include/cache.h

@ -286,16 +286,21 @@ class PostgreSQLCache: public GenericCache
if(!regdest) if(!regdest)
{ {
// Create table // Create table
if(false) {
auto* res = PQexec(conn, "SET client_min_messages=WARNING;");
PQclear(res);
}
{ {
auto* res = PQexec(conn, "CREATE TABLE IF NOT EXISTS cache(key TEXT PRIMARY KEY NOT NULL, value BYTEA, exptime TIMESTAMP(0) NOT NULL);"); auto* res = PQexec(conn, "CREATE TABLE IF NOT EXISTS cache(key TEXT PRIMARY KEY NOT NULL, value BYTEA, exptime TIMESTAMP(0) NOT NULL);");
if(PQresultStatus(res) != PGRES_COMMAND_OK) if(PQresultStatus(res) != PGRES_COMMAND_OK)
{ {
michlib::errmessage(PQresStatus(PQresultStatus(res))); michlib::errmessage(PQresStatus(PQresultStatus(res)));
michlib::errmessage(PQerrorMessage(conn)); michlib::errmessage(PQerrorMessage(conn));
}
PQclear(res); PQclear(res);
} }
else {
auto* res = PQexec(conn, "SET client_min_messages=NOTICE;");
PQclear(res); PQclear(res);
} }

Loading…
Cancel
Save