Removed the acl field from several Pg* classes as the acl is now stored in the PgServerObject base class they inherit from.

This commit is contained in:
eelke 2018-12-27 12:05:48 +01:00
parent aaa05f64ef
commit 93687df959
12 changed files with 30 additions and 30 deletions

View file

@ -52,7 +52,6 @@ public:
bool ispopulated;
int frozenxid;
int minmxid;
QString acl;
std::vector<QString> options;
using PgNamespaceObject::PgNamespaceObject;

View file

@ -11,7 +11,7 @@ std::string PgClassContainer::getLoadQuery() const
" relowner, relam, relfilenode, reltablespace, relpages, "
" reltuples, reltoastrelid, relisshared, relpersistence, "
" relkind, relhasoids, relispopulated, relfrozenxid, relminmxid, "
" relacl, reloptions \n"
" reloptions, relacl \n"
"FROM pg_catalog.pg_class";
}
@ -28,12 +28,12 @@ PgClass PgClassContainer::loadElem(const Pgsql::Row &row)
>> owner >> v.am >> v.filenode >> v.tablespace >> v.pages_est
>> v.tuples_est >> v.toastrelid >> v.isshared >> v.persistence
>> v.kind >> v.hasoids >> v.ispopulated >> v.frozenxid >> v.minmxid
>> v.acl >> v.options;
>> v.options;
v.setOwnerOid(owner);
// auto&& ns = m_catalog.namespaces()->getByKey(v.relnamespace);
// if (ns) {
// v.relnamespace_name = ns->objectName();
// v.system_namespace = ns->isSystemCatalog();
// }
AclList acl_list;
col >> acl_list;
v.setAcls(std::move(acl_list));
return v;
}

View file

@ -16,7 +16,6 @@ public:
bool allowConn;
int connLimit;
Oid tablespace;
QString acl;//"ARRAY";"YES"
using PgServerObject::PgServerObject;

View file

@ -15,7 +15,12 @@ PgDatabase PgDatabaseContainer::loadElem(const Pgsql::Row &row)
QString name = col.nextValue();
PgDatabase v(m_catalog, oid, name);
col >> v.dba >> v.encoding >> v.collate >> v.ctype >> v.isTemplate
>> v.allowConn >> v.connLimit >> v.tablespace >> v.acl;
>> v.allowConn >> v.connLimit >> v.tablespace;
AclList acl_list;
col >> acl_list;
v.setAcls(std::move(acl_list));
return v;
}

View file

@ -17,7 +17,6 @@ public:
Oid plcallfoid;
Oid inline_;
Oid validator;
QString acl;
using PgDatabaseObject::PgDatabaseObject;

View file

@ -14,9 +14,13 @@ PgLanguage PgLanguageContainer::loadElem(const Pgsql::Row &row)
Pgsql::Col col(row);
Oid lan_oid = col.nextValue();
QString name = col.nextValue();
Oid owner = col.nextValue();
PgLanguage v(m_catalog, lan_oid, name);
col >> v.ispl >> v.pltrusted >> v.plcallfoid >> v.inline_ >> v.validator >> v.acl;
Oid owner;
AclList acl_list;
col >> owner >> v.ispl >> v.pltrusted >> v.plcallfoid >> v.inline_ >> v.validator >> acl_list;
v.setOwnerOid(owner);
v.setAcls(std::move(acl_list));
return v;
}

View file

@ -9,9 +9,6 @@
/// Object representing a namespace within a database
class PgNamespace: public PgDatabaseObject {
public:
Oid owner = InvalidOid;
QString acl;
using PgDatabaseObject::PgDatabaseObject;
bool isSystemCatalog() const;

View file

@ -15,7 +15,12 @@ PgNamespace PgNamespaceContainer::loadElem(const Pgsql::Row &row)
Oid oid = col.nextValue();
QString name = col.nextValue();
PgNamespace v(m_catalog, oid, name);
col >> v.owner >> v.acl;
Oid owner;
AclList acl_list;
col >> owner >> acl_list;
v.setOwnerOid(owner);
v.setAcls(std::move(acl_list));
return v;
}

View file

@ -29,11 +29,7 @@ void operator<<(TypCategory &s, const Pgsql::Value &v);
class PgType: public PgNamespaceObject {
public:
// Oid oid = InvalidOid;
// QString name; // formatted name as per database, arrays
QString typname; //"name";"NO"
// Oid typnamespace = InvalidOid;//"oid";"NO"
// Oid owner = InvalidOid;//"oid";"NO"
short len = -1;//"smallint";"NO"
bool byval = false;//"boolean";"NO"
QString type;//""char"";"NO"
@ -60,16 +56,10 @@ public:
Oid collation = InvalidOid;//"oid";"NO"
QString defaultbin;//"pg_node_tree";"YES"
QString typdefault;//"text";"YES"
QString acl;//"ARRAY";"YES"
using PgNamespaceObject::PgNamespaceObject;
QString typeName() const override;
// bool operator==(Oid _oid) const { return oid == _oid; }
// bool operator==(const QString &n) const { return name == n; }
// bool operator<(Oid _oid) const { return oid < _oid; }
// bool operator<(const PgType &rhs) const { return oid < rhs.oid; }
};
#endif // PGTYPE_H

View file

@ -22,10 +22,12 @@ PgType PgTypeContainer::loadElem(const Pgsql::Row &row)
Oid ns_oid = col.nextValue();
Oid owner = col.nextValue();
PgType v(m_catalog, type_oid, name, ns_oid);
AclList acl_list;
col >> v.typname >> v.len >> v.byval >> v.type >> v.category
>> v.ispreferred >> v.isdefined >> v.delim >> v.relid >> v.elem >> v.array >> v.input >> v.output
>> v.receive >> v.send >> v.modin >> v.modout >> v.analyze >> v.align >> v.storage >> v.notnull
>> v.basetype >> v.typmod >> v.ndims >> v.collation >> v.defaultbin >> v.typdefault >> v.acl;
>> v.basetype >> v.typmod >> v.ndims >> v.collation >> v.defaultbin >> v.typdefault >> acl_list;
v.setOwnerOid(owner);
v.setAcls(std::move(acl_list));
return v;
}