--- a/src/server/plugins/postgresql/webdav.c Sat Aug 27 11:57:27 2022 +0200 +++ b/src/server/plugins/postgresql/webdav.c Thu Sep 08 17:34:16 2022 +0200 @@ -1197,6 +1197,11 @@ snprintf(resource_id_str, 32, "%" PRId64, proppatch->resource_id); params[0] = resource_id_str; + printf("insert\n\n"); + printf("arg0: %s\narg1: %s\n", params[0], params[1]); + printf("%s\n\n", sql->space); + + PGresult *result = PQexecParams( pgdav->connection, sql->space, @@ -1213,6 +1218,7 @@ if(PQresultStatus(result) == PGRES_COMMAND_OK) { // command ok, check if any row was updated char *nrows_affected = PQcmdTuples(result); + printf("insert nrows: %s\n", nrows_affected); if(nrows_affected[0] == '1') { ret = 0; } else { @@ -1222,7 +1228,6 @@ log_ereport(LOG_FAILURE, "pg: extension row insert failed: %s", PQresultErrorMessage(result)); } - PQclear(result); return ret; @@ -1247,6 +1252,8 @@ snprintf(resource_id_str, 32, "%" PRId64, proppatch->resource_id); params[0] = resource_id_str; + printf("update\n"); + PGresult *result = PQexecParams( pgdav->connection, sql->space, @@ -1263,6 +1270,7 @@ if(PQresultStatus(result) == PGRES_COMMAND_OK) { // command ok, check if any row was updated char *nrows_affected = PQcmdTuples(result); + printf("nrows: %s\n", nrows_affected); if(nrows_affected[0] == '1') { ret = 0; } else if(nrows_affected[0] == '0') { @@ -1415,6 +1423,7 @@ PgWebdavBackend *pgdav = request->dav->instance; int ret = 0; if(!commit) { + log_ereport(LOG_VERBOSE, "proppatch: rollback"); PGresult *result = PQexec(pgdav->connection, "rollback to savepoint proppatch;"); if(PQresultStatus(result) != PGRES_COMMAND_OK) { log_ereport(LOG_FAILURE, "pg_dav_proppatch_finish: rollback failed: %s", PQerrorMessage(pgdav->connection));