conn = PQconnectdb("dbname=usr host=localhost user=admin password=mypwd");
if (PQstatus(conn) == CONNECTION_BAD)
puts("We were unable to connect to the database");
res = PQexec(conn, "UPDATE public.users SET unique_id='5' WHERE ID ='2'");
if (PQresultStatus(res) == PGRES_TUPLES_OK)
rec_count = PQntuples(res);
There's code missing (headers), you need to post a short, self-contained, correct (and hopefully compileable) example: http://www.sscce.org/
Not everyone here knows anything about the 3rd party library you use, what is it, let alone uses it.