The create table statement now lists the inherited tables and inherited columns are commented out.
This commit is contained in:
parent
498233d58c
commit
6c76c70a97
11 changed files with 118 additions and 6 deletions
29
pglablib/PgInheritsContainer.cpp
Normal file
29
pglablib/PgInheritsContainer.cpp
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
#include "PgInheritsContainer.h"
|
||||
#include "Pgsql_Col.h"
|
||||
#include "PgDatabaseCatalog.h"
|
||||
#include <algorithm>
|
||||
|
||||
std::vector<Oid> PgInheritsContainer::getParentsOf(Oid oid) const
|
||||
{
|
||||
std::vector<Oid> result;
|
||||
auto&& iter = std::lower_bound(m_container.begin(), m_container.end(), PgInherits::Key{ oid, 1 });
|
||||
for (;iter != m_container.end() && iter->relid == oid; ++iter)
|
||||
result.push_back(iter->parent);
|
||||
return result;
|
||||
}
|
||||
|
||||
std::string PgInheritsContainer::getLoadQuery() const
|
||||
{
|
||||
return
|
||||
"SELECT inhrelid, inhparent, inhseqno \n"
|
||||
" FROM pg_inherits";
|
||||
}
|
||||
|
||||
|
||||
PgInherits PgInheritsContainer::loadElem(const Pgsql::Row &row)
|
||||
{
|
||||
Pgsql::Col col(row);
|
||||
PgInherits v;
|
||||
col >> v.relid >> v.parent >> v.seqno;
|
||||
return v;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue