diff --git a/pglab/TablesTableModel.cpp b/pglab/TablesTableModel.cpp index ab21483..db3336a 100644 --- a/pglab/TablesTableModel.cpp +++ b/pglab/TablesTableModel.cpp @@ -40,7 +40,8 @@ void TablesTableModel::reloadData() m_tables.clear(); for (const auto &e : *classes) { bool add = false; - if (e.kind == RelKind::Table) { + if (e.kind == RelKind::Table || e.kind == RelKind::View + || e.kind == RelKind::MaterializedView || e.kind == RelKind::ForeignTable) { switch (m_namespaceFilter) { case TablesTableModel::User: add = !e.ns().isSystemCatalog(); @@ -121,6 +122,7 @@ QVariant TablesTableModel::headerData(int section, Qt::Orientation orientation, switch (section) { case NameCol: return tr("Name"); case NamespaceCol: return tr("Schema"); + case KindCol: return tr("Kind"); case OwnerCol: return tr("Owner"); case TablespaceCol: return tr("Tablespace"); case OptionsCol: return tr("Options"); @@ -150,6 +152,7 @@ Oid TablesTableModel::getType(int column) const case OwnerCol: case NameCol: case NamespaceCol: + case KindCol: case OptionsCol: case AclCol: default: @@ -164,6 +167,7 @@ QVariant TablesTableModel::getData(const QModelIndex &index) const switch (index.column()) { case NameCol: return t.objectName(); case NamespaceCol: return t.nsName(); + case KindCol: return t.typeName(); case OwnerCol: return t.ownerName(); case TablespaceCol: return getTablespaceDisplayString(*m_catalog, t.tablespace); case OptionsCol: break; diff --git a/pglab/TablesTableModel.h b/pglab/TablesTableModel.h index 351fb21..534c663 100644 --- a/pglab/TablesTableModel.h +++ b/pglab/TablesTableModel.h @@ -16,6 +16,7 @@ public: enum e_Columns : int { NameCol, ///< either table, ns.table or table (ns) depending on settings/filters NamespaceCol, + KindCol, OwnerCol, TablespaceCol, OptionsCol, diff --git a/pglablib/catalog/PgClass.h b/pglablib/catalog/PgClass.h index 3e67e29..3a49951 100644 --- a/pglablib/catalog/PgClass.h +++ b/pglablib/catalog/PgClass.h @@ -63,6 +63,7 @@ public: // bool operator<(Oid _oid) const { return oid < _oid; } // bool operator<(const PgClass &rhs) const { return oid < rhs.oid; } + QString kindString() const; QString createSql() const; QString typeName() const override; QString aclAllPattern() const override; diff --git a/pglablib/catalog/PgClassContainer.cpp b/pglablib/catalog/PgClassContainer.cpp index f2124bb..3d01f79 100644 --- a/pglablib/catalog/PgClassContainer.cpp +++ b/pglablib/catalog/PgClassContainer.cpp @@ -13,7 +13,7 @@ std::string PgClassContainer::getLoadQuery() const " relkind, relhasoids, relispopulated, relfrozenxid, relminmxid, " " reloptions, relacl \n" "FROM pg_catalog.pg_class \n" - "WHERE relkind IN ('r', 'i', 'p', 'I')"; + "WHERE relkind IN ('r', 'i', 'p', 'I', 'v', 'm', 'f')"; } PgClass PgClassContainer::loadElem(const Pgsql::Row &row)