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

13
include/cache.h

@ -286,17 +286,22 @@ 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);
} }
else PQclear(res);
PQclear(res); }
{
auto* res = PQexec(conn, "SET client_min_messages=NOTICE;");
PQclear(res);
} }
conn.AddDestructor( conn.AddDestructor(

Loading…
Cancel
Save