rem: if(begin_transaction(_h, sql_buf)) return(-1); if (submit_query(_h, sql_buf) < 0) { LOG(L_ERR, "db_delete(): Error while deleting\n"); return -2; } free_query(_h); commit_transaction(_h); return(0);
add: params = 0; delete = 0;  delete = print_delete(con, keys, ops, n); if (!delete) goto err;  params = new_pg_params(n); if (!params) goto err; if (params_add(params, con, vals, n) < 0) goto err;  do { ret = submit_query(0, con, delete, params); if (ret < 0) goto err;                        if (ret > 0) {                                if (reconnect(con) < 0) goto err;     else continue;                        } } while(ret != 0);  free_pg_params(params); pkg_free(delete); return 0;  err: if (params) free_pg_params(params); if (delete) pkg_free(delete); return -1;
context: int db_delete(db_con_t* _h, db_key_t* _k, db_op_t* _o, db_val_t* _v, int _n){	int off;	off = snprintf(sql_buf, SQL_BUF_LEN, "delete from %s", CON_TABLE(_h));	if (_n) {		off += snprintf(sql_buf + off, SQL_BUF_LEN - off, " where ");		off += print_where(sql_buf + off, SQL_BUF_LEN - off, _k,			_o, _v, _n);	}	if(begin_transaction(_h, sql_buf)) return(-1);	if (submit_query(_h, sql_buf) < 0) {		LOG(L_ERR, "db_delete(): Error while deleting\n");		return -2;	}	free_query(_h);	commit_transaction(_h);	return(0);}