pgLab/pglablib/catalog/PgCollationContainer.cpp
eelke c2c01cf431 Generic GRANT/REVOKE generation from ACL's complete.
Moved the owned concept to PgServerObject as it is needed for the generic
acl functionality that is also in PgServerObject.
2018-12-25 14:25:15 +01:00

28 lines
697 B
C++

#include "PgCollationContainer.h"
#include "Pgsql_Connection.h"
#include "Pgsql_Col.h"
#include "PgDatabaseCatalog.h"
#include <iterator>
std::string PgCollationContainer::getLoadQuery() const
{
return "SELECT oid, collname, collnamespace, collowner, collencoding, \n"
" collcollate, collctype \n"
"FROM pg_collation";
}
PgCollation PgCollationContainer::loadElem(const Pgsql::Row &row)
{
Pgsql::Col col(row);
Oid class_oid = col.nextValue();
QString name = col.nextValue();
Oid ns_oid = col.nextValue();
PgCollation v(m_catalog, class_oid, name, ns_oid);
Oid owner ;
col >> owner >> v.collencoding >> v.collcollate >> v.collctype;
v.setOwnerOid(owner);
return v;
}