diff --git a/feed_info.c b/feed_info.c index a1225cb..f9e156a 100644 --- a/feed_info.c +++ b/feed_info.c @@ -51,7 +51,7 @@ zblock_feed_info_err zblock_feed_info_exists(PGconn *conn, const char *url, u64s snprintf(channel_id_str, sizeof(channel_id_str), "%" PRId64, channel_id); const char *const params[] = {url, channel_id_str}; - PGresult *res = PQexecParams(conn, "SELECT COUNT(1) FROM feeds WHERE url = $1 AND channel_id = $2", 2, NULL, params, NULL, NULL, 0); + PGresult *res = PQexecParams(conn, "SELECT COUNT(1) FROM feeds WHERE url = $1 AND channel_id = $2", 2, NULL, params, NULL, NULL, 1); if (PQresultStatus(res) != PGRES_TUPLES_OK) { log_error(PQresultErrorMessage(res)); PQclear(res); diff --git a/main.c b/main.c index 27826c7..a1e246f 100644 --- a/main.c +++ b/main.c @@ -63,7 +63,10 @@ static void timer_retrieve_feeds(struct discord *client, struct discord_timer *t // all this SQL stuff should *really* be extracted somewhere else // maybe make a function where you can do a lookup with a quantity and offset - PGresult *database_res = PQexec(database_conn, "SELECT url, last_pubDate, channel_id from feeds"); + PGresult *database_res = PQexecParams( + database_conn, "SELECT url, last_pubDate, channel_id from feeds", + 0, NULL, NULL, NULL, NULL, 1 + ); if (PQresultStatus(database_res) != PGRES_TUPLES_OK) { log_error("Unable to retrieve feed list: %s", PQresultErrorMessage(database_res)); PQclear(database_res);