{
int res;
int count=30;
+ PGresult *result;
Dmsg0(500, "my_postgresql_batch_end started\n");
if (!mdb) { /* no files ? */
mdb->status = 0;
Mmsg1(&mdb->errmsg, _("error ending batch mode: %s"), PQerrorMessage(mdb->db));
}
-
+
+ /* Check command status and return to normal libpq state */
+ result = PQgetResult(mdb->db);
+ if (PQresultStatus(result) != PGRES_COMMAND_OK) {
+ Mmsg1(&mdb->errmsg, _("error ending batch mode: %s"), PQerrorMessage(mdb->db));
+ mdb->status = 0;
+ }
+ PQclear(result);
+
Dmsg0(500, "my_postgresql_batch_end finishing\n");
return mdb->status;
if (res <= 0) {
Dmsg0(500, "we failed\n");
mdb->status = 0;
- Mmsg1(&mdb->errmsg, _("error ending batch mode: %s"), PQerrorMessage(mdb->db));
+ Mmsg1(&mdb->errmsg, _("error copying in batch mode: %s"), PQerrorMessage(mdb->db));
}
Dmsg0(500, "my_postgresql_batch_insert finishing\n");
15Jul09
kes Fix Win64 build
kes Add more example SD Device configurations.
+ebl Fix #1335 about postgresql error message during copy session
ebl Cleanup old job records when starting the director
(Created/Running -> Failed)
ebl Force the client_encoding to SQL_ASCII when database is already