if (!pset.db)
{
pg_log_error("%s: not connected to a database", operation); returnfalse;
}
tstatus = PQtransactionStatus(pset.db);
switch (tstatus)
{ case PQTRANS_IDLE: /* need to start our own xact */ if (!(res = PSQLexec("BEGIN"))) returnfalse;
PQclear(res);
*own_transaction = true; break; case PQTRANS_INTRANS: /* use the existing xact */ break; case PQTRANS_INERROR:
pg_log_error("%s: current transaction is aborted", operation); returnfalse; default:
pg_log_error("%s: unknown transaction status", operation); returnfalse;
}
if (own_transaction && pset.autocommit)
{ /* close out our own xact */ if (!(res = PSQLexec("COMMIT")))
{
res = PSQLexec("ROLLBACK");
PQclear(res); returnfalse;
}
PQclear(res);
}
if (!start_lo_xact("\\lo_export", &own_transaction)) returnfalse;
SetCancelConn(NULL);
status = lo_export(pset.db, atooid(loid_arg), filename_arg);
ResetCancelConn();
/* of course this status is documented nowhere :( */ if (status != 1)
{
pg_log_info("%s", PQerrorMessage(pset.db)); return fail_lo_xact("\\lo_export", own_transaction);
}
if (!finish_lo_xact("\\lo_export", own_transaction)) returnfalse;
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.