Show view definition

This commit is contained in:
eelke 2019-10-26 13:13:58 +02:00
parent dc949f3c34
commit ead3ce8a8a
3 changed files with 26 additions and 1 deletions

View file

@ -11,7 +11,7 @@ std::string PgClassContainer::getLoadQuery() const
" relowner, relam, relfilenode, reltablespace, relpages, "
" reltuples, reltoastrelid, relisshared, relpersistence, "
" relkind, relispopulated, relfrozenxid, relminmxid, "
" reloptions, relacl";
" reloptions, relacl, pg_get_viewdef(oid)";
if (lessThenVersion(120000))
q += ", relhasoids ";
@ -45,6 +45,10 @@ PgClass PgClassContainer::loadElem(const Pgsql::Row &row)
col >> acl_list;
v.setAcls(std::move(acl_list));
auto vd = col.nextValue();
if (!vd.null())
v.viewdef = vd.asQString();
if (lessThenVersion(120000))
col >> v.hasoids;