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 | |||
@@ -128,25 +128,25 @@ s_pgsql_query(struct sql_connect *conn, const char *query) | |||
128 | 128 | ||
129 | res = PQexec(pgconn, query); | 129 | res = PQexec(pgconn, query); |
130 | if (!res) | 130 | if (!res) |
131 | scm_throw(gsql_error, | 131 | scm_throw(gsql_error, |
132 | scm_list_2(scm_makfrom0str("Error executing PostgreSQL query"), | 132 | scm_list_2(scm_makfrom0str("Error executing PostgreSQL query"), |
133 | scm_makfrom0str(PQerrorMessage(pgconn)))); | 133 | scm_makfrom0str(PQerrorMessage(pgconn)))); |
134 | 134 | ||
135 | stat = PQresultStatus(res); | 135 | stat = PQresultStatus(res); |
136 | 136 | ||
137 | switch (stat) { | 137 | switch (stat) { |
138 | case PGRES_COMMAND_OK: | 138 | case PGRES_COMMAND_OK: |
139 | /* Successful completion of a command returning no data */ | 139 | /* Successful completion of a command returning no data */ |
140 | cell = scm_makenum(strtoul(PQcmdTuples(res), NULL, 0)); | 140 | cell = scm_to_ulong(strtoul(PQcmdTuples(res), NULL, 0)); |
141 | break; | 141 | break; |
142 | case PGRES_TUPLES_OK: | 142 | case PGRES_TUPLES_OK: |
143 | /* The query successfully executed */ | 143 | /* The query successfully executed */ |
144 | cell = result_to_list(res); | 144 | cell = result_to_list(res); |
145 | PQclear(res); | 145 | PQclear(res); |
146 | break; | 146 | break; |
147 | default: | 147 | default: |
148 | scm_throw(gsql_error, scm_list_2(scm_makfrom0str("PostgreSQL error"), | 148 | scm_throw(gsql_error, scm_list_2(scm_makfrom0str("PostgreSQL error"), |
149 | scm_makfrom0str(PQresStatus(stat)))); | 149 | scm_makfrom0str(PQresStatus(stat)))); |
150 | } | 150 | } |
151 | 151 | ||
152 | return cell; | 152 | return cell; |