From 8cb1d6eab38685d4936718fd8969dcde15e472ff Mon Sep 17 00:00:00 2001 From: eelke Date: Sat, 21 Apr 2018 10:50:04 +0200 Subject: [PATCH] Permission denied errors are now being ignored while reading the system catalog. Other parts of the program will have to cope with the fact that not all data will be available. Close #4 --- pglablib/PgDatabaseCatalog.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/pglablib/PgDatabaseCatalog.cpp b/pglablib/PgDatabaseCatalog.cpp index 10e0903..53e0d5d 100644 --- a/pglablib/PgDatabaseCatalog.cpp +++ b/pglablib/PgDatabaseCatalog.cpp @@ -180,8 +180,12 @@ void load(Pgsql::Connection &conn, IPgContainter &pg_cont) } else { auto details = result.diagDetails(); - - throw std::runtime_error("Query failed\n" + details.errorMessage); + if (details.state == "42501") { // permission denied + // ignore this for now + } + else { + throw std::runtime_error("Query failed\n" + details.errorMessage); + } } }