* PQexec * send a query to the backend and package up the result in a PGresult * * If the query was not even sent, return NULL; conn->errorMessage is set to * a relevant message. * If the query was sent, a new PGresult is returned (which could indicate * either success or failure). * The user is responsible for freeing the PGresult via PQclear() * when done with it. */
| 2229 | * when done with it. |
| 2230 | */ |
| 2231 | PGresult * |
| 2232 | PQexec(PGconn *conn, const char *query) |
| 2233 | { |
| 2234 | if (!PQexecStart(conn)) |
| 2235 | return NULL; |
| 2236 | if (!PQsendQuery(conn, query)) |
| 2237 | return NULL; |
| 2238 | return PQexecFinish(conn); |
| 2239 | } |
| 2240 | |
| 2241 | /* |
| 2242 | * PQexecParams |