|
|
|
@ -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( |
|
|
|
|