• PQexec(cnxn, "..."):
    • PQexec is the function for submitting commands (with no parameters) to Postgres.
    • The command is carried over the connection — cnxn — which also carries back results.

  • PQresultStatus(res) != PGRES_COMMAND_OK: Check for correct execution.

  • PQclear(res): Cleanup the result from the database. (Memory management — if you don't do this, valgrind will report a leak.)