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

13
include/cache.h

@ -286,17 +286,22 @@ class PostgreSQLCache: public GenericCache
if(!regdest)
{
// 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);");
if(PQresultStatus(res) != PGRES_COMMAND_OK)
{
michlib::errmessage(PQresStatus(PQresultStatus(res)));
michlib::errmessage(PQerrorMessage(conn));
PQclear(res);
}
else
PQclear(res);
PQclear(res);
}
{
auto* res = PQexec(conn, "SET client_min_messages=NOTICE;");
PQclear(res);
}
conn.AddDestructor(

Loading…
Cancel
Save