MCPcopy Create free account
hub / github.com/ElementsProject/lightning / db_postgres_vacuum

Function db_postgres_vacuum

db/db_postgres.c:254–272  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

252}
253
254static bool db_postgres_vacuum(struct db *db)
255{
256 PGresult *res;
257
258 /* This can use a lot of diskspacem breaking CI! */
259 if (getenv("LIGHTNINGD_POSTGRES_NO_VACUUM")
260 && streq(getenv("LIGHTNINGD_POSTGRES_NO_VACUUM"), "1"))
261 return true;
262
263 res = PQexec(db->conn, "VACUUM FULL;");
264 if (PQresultStatus(res) != PGRES_COMMAND_OK) {
265 db->error = tal_fmt(db, "VACUUM command failed: %s",
266 PQerrorMessage(db->conn));
267 PQclear(res);
268 return false;
269 }
270 PQclear(res);
271 return true;
272}
273
274static bool db_postgres_rename_column(struct db *db,
275 const char *tablename,

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected