Tab with list of sequences and create sql for selected sequence.
This commit is contained in:
parent
769307c821
commit
437736a023
19 changed files with 507 additions and 63 deletions
|
|
@ -1,5 +1,6 @@
|
|||
#include "PgContainer.h"
|
||||
#include "PgDatabaseCatalog.h"
|
||||
#include "Pgsql_Connection.h"
|
||||
|
||||
IPgContainer::IPgContainer(PgDatabaseCatalog& cat)
|
||||
: m_catalog(cat)
|
||||
|
|
@ -9,3 +10,26 @@ bool IPgContainer::minimumVersion(int required_version) const
|
|||
{
|
||||
return m_catalog.serverVersion() >= required_version;
|
||||
}
|
||||
|
||||
bool IPgContainer::lessThenVersion(int required_version) const
|
||||
{
|
||||
return m_catalog.serverVersion() < required_version;
|
||||
}
|
||||
|
||||
void IPgContainer::loadAll(Pgsql::Connection &conn)
|
||||
{
|
||||
std::string q = getLoadQuery();
|
||||
Pgsql::Result result = conn.query(q.c_str());
|
||||
if (result && result.resultStatus() == PGRES_TUPLES_OK) {
|
||||
load(result);
|
||||
}
|
||||
else {
|
||||
auto details = result.diagDetails();
|
||||
if (details.state == "42501") { // permission denied
|
||||
// ignore this for now
|
||||
}
|
||||
else {
|
||||
throw std::runtime_error("Query failed\n" + details.errorMessage);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue