summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
30a4eee)
In pg_delete_key() we deleted the key from onak_keys as the first
action, which would fail because the other tables had a reference to
that object via a foreign key relation. The correct approach is to
delete the key itself last, after the signature and UID tables have had
their entries deleted.
PQclear(result);
snprintf(statement, 1023,
PQclear(result);
snprintf(statement, 1023,
- "DELETE FROM onak_keys WHERE keyid = '%" PRIX64 "'",
+ "DELETE FROM onak_sigs WHERE signee = '%" PRIX64 "'",
keyid);
result = PQexec(dbconn, statement);
PQclear(result);
snprintf(statement, 1023,
keyid);
result = PQexec(dbconn, statement);
PQclear(result);
snprintf(statement, 1023,
- "DELETE FROM onak_sigs WHERE signee = '%" PRIX64 "'",
+ "DELETE FROM onak_uids WHERE keyid = '%" PRIX64 "'",
keyid);
result = PQexec(dbconn, statement);
PQclear(result);
snprintf(statement, 1023,
keyid);
result = PQexec(dbconn, statement);
PQclear(result);
snprintf(statement, 1023,
- "DELETE FROM onak_uids WHERE keyid = '%" PRIX64 "'",
+ "DELETE FROM onak_keys WHERE keyid = '%" PRIX64 "'",
keyid);
result = PQexec(dbconn, statement);
} else if (PQresultStatus(result) != PGRES_TUPLES_OK) {
keyid);
result = PQexec(dbconn, statement);
} else if (PQresultStatus(result) != PGRES_TUPLES_OK) {