Loading of index definitions
This commit is contained in:
parent
db75d9ed50
commit
aef9b914b1
7 changed files with 95 additions and 27 deletions
28
pglab/PgIndexContainer.cpp
Normal file
28
pglab/PgIndexContainer.cpp
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
#include "PgIndexContainer.h"
|
||||
#include "Pgsql_Col.h"
|
||||
#include <iterator>
|
||||
|
||||
std::string PgIndexContainer::getLoadQuery() const
|
||||
{
|
||||
return R"__(
|
||||
SELECT indexrelid, indrelid, indnatts, indisunique, indisprimary,
|
||||
indisexclusion, indimmediate, indisclustered, indisvalid,
|
||||
indcheckxmin, indisready, indislive, indisreplident, indkey,
|
||||
indcollation, indclass, indoption, indexprs, indpred
|
||||
FROM pg_index)__";
|
||||
}
|
||||
|
||||
PgIndex PgIndexContainer::loadElem(const Pgsql::Row &row)
|
||||
{
|
||||
Pgsql::Col col(row);
|
||||
PgIndex v;
|
||||
col >> v.indexrelid >> v.relid >> v.natts >> v.isunique
|
||||
>> v.isprimary >> v.isexclusion >> v.immediate >> v.isclustered
|
||||
>> v.isvalid >> v.checkxmin >> v.isready >> v.islive >> v.isreplident;
|
||||
col.getAsVector<int16_t>(std::back_inserter(v.key));
|
||||
col.getAsVector<Oid>(std::back_inserter(v.collation));
|
||||
col.getAsVector<Oid>(std::back_inserter(v.indclass));
|
||||
col.getAsVector<int16_t>(std::back_inserter(v.option));
|
||||
col >> v.exprs >> v.pred;
|
||||
return v;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue