diff options
Diffstat (limited to 'src/pgsql.c')
-rw-r--r-- | src/pgsql.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/pgsql.c b/src/pgsql.c index 2a7fe23..c1a8e41 100644 --- a/src/pgsql.c +++ b/src/pgsql.c @@ -116,49 +116,49 @@ result_to_list(PGresult *res) row_tail = new_row; } return row_head; } static SCM s_pgsql_query(struct sql_connect *conn, const char *query) { PGconn *pgconn = (PGconn*) conn->data; PGresult *res; SCM cell; ExecStatusType stat; res = PQexec(pgconn, query); if (!res) scm_throw(gsql_error, scm_list_2(scm_makfrom0str("Error executing PostgreSQL query"), scm_makfrom0str(PQerrorMessage(pgconn)))); stat = PQresultStatus(res); switch (stat) { case PGRES_COMMAND_OK: /* Successful completion of a command returning no data */ - cell = scm_makenum(strtoul(PQcmdTuples(res), NULL, 0)); + cell = scm_to_ulong(strtoul(PQcmdTuples(res), NULL, 0)); break; case PGRES_TUPLES_OK: /* The query successfully executed */ cell = result_to_list(res); PQclear(res); break; default: scm_throw(gsql_error, scm_list_2(scm_makfrom0str("PostgreSQL error"), scm_makfrom0str(PQresStatus(stat)))); } return cell; } static void s_pgsql_close(struct sql_connect *conn) { PGconn *pgconn = (PGconn*) conn->data; if (!pgconn) return; PQfinish(pgconn); conn->data = NULL; } |