Rework of catalog objects. Several of them are now inheriting from common

base classes that implement common functionality.
This commit is contained in:
eelke 2018-11-25 19:45:06 +01:00
parent 840af1e0a9
commit 73c4cf4790
45 changed files with 340 additions and 265 deletions

View file

@ -7,7 +7,7 @@
std::string PgTriggerContainer::getLoadQuery() const
{
std::string q =
"SELECT oid, tgrelid, tgname, tgfoid, tgtype, tgenabled, tgisinternal, tgconstrrelid, \n"
"SELECT oid, tgname, tgrelid, tgfoid, tgtype, tgenabled, tgisinternal, tgconstrrelid, \n"
" tgconstrindid, tgconstraint, tgdeferrable, tginitdeferred, tgnargs, tgattr, \n"
" tgargs, COALESCE(substring(pg_get_triggerdef(oid), 'WHEN (.*) EXECUTE PROCEDURE'), substring(pg_get_triggerdef(oid), 'WHEN (.*) \\$trigger')) AS whenclause";
if (minimumVersion(90600)) {
@ -23,8 +23,10 @@ PgTrigger PgTriggerContainer::loadElem(const Pgsql::Row &row)
{
Pgsql::Col col(row);
PgTrigger v(m_catalog);
col >> v.oid >> v.relid >> v.name >> v.foid >> v.type >> v.enabled >> v.isinternal >> v.constrrelid
Oid oid = col.nextValue();
QString name = col.nextValue();
PgTrigger v(m_catalog, oid, name, InvalidOid);
col >> v.relid >> v.foid >> v.type >> v.enabled >> v.isinternal >> v.constrrelid
>> v.constrindid >> v.constraint >> v.deferrable >> v.initdeferred >> v.nargs >> v.attr;
const unsigned char * args_bytea = reinterpret_cast<const unsigned char *>(col.nextValue().c_str());
if (args_bytea) {