Revert "Delete and re-add libpqxx-7.7.3 due to weird corruption."
This reverts commit e96515433d
.
This commit is contained in:
parent
c07e4a8c01
commit
be7ce4110e
457 changed files with 110654 additions and 0 deletions
39
ext/libpqxx-7.7.3/tools/rmlo.cxx
Normal file
39
ext/libpqxx-7.7.3/tools/rmlo.cxx
Normal file
|
@ -0,0 +1,39 @@
|
|||
// Remove large objects given on the command line from the default database.
|
||||
#include <iostream>
|
||||
|
||||
#include "pqxx/pqxx"
|
||||
|
||||
|
||||
int main(int, char *argv[])
|
||||
{
|
||||
pqxx::connection conn;
|
||||
bool failures = false;
|
||||
|
||||
try
|
||||
{
|
||||
for (int i{1}; argv[i]; ++i)
|
||||
{
|
||||
auto o{pqxx::from_string<pqxx::oid>(argv[i])};
|
||||
try
|
||||
{
|
||||
pqxx::perform([o, &conn] {
|
||||
pqxx::work tx{conn};
|
||||
pqxx::blob::remove(tx, o);
|
||||
tx.commit();
|
||||
});
|
||||
}
|
||||
catch (std::exception const &e)
|
||||
{
|
||||
std::cerr << e.what() << std::endl;
|
||||
failures = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (std::exception const &e)
|
||||
{
|
||||
std::cerr << e.what() << std::endl;
|
||||
return 2;
|
||||
}
|
||||
|
||||
return failures;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue