Fix errors on PG 9.5 en 9.6 (maybe other versions to)

Closes #68
This commit is contained in:
eelke 2021-04-01 14:55:20 +02:00
parent 9c9e78c54b
commit bdef76ed8a
2 changed files with 6 additions and 6 deletions

View file

@ -7,15 +7,15 @@
std::string PgClassContainer::getLoadQuery() const
{
std::string q = "SELECT oid, relname, relnamespace, reltype, reloftype, "
std::string q = "SELECT pg_class.oid, relname, relnamespace, reltype, reloftype, "
" relowner, relam, relfilenode, reltablespace, relpages, "
" reltuples, reltoastrelid, relisshared, relpersistence, "
" relkind, relispopulated, relfrozenxid, relminmxid, "
" reloptions, d.description, "
" pg_total_relation_size(oid) AS total_bytes, "
" CASE WHEN relkind='r' THEN pg_indexes_size(oid) ELSE 0 END AS index_bytes, "
" pg_total_relation_size(pg_class.oid) AS total_bytes, "
" CASE WHEN relkind='r' THEN pg_indexes_size(pg_class.oid) ELSE 0 END AS index_bytes, "
" CASE WHEN relkind='r' THEN pg_total_relation_size(reltoastrelid) ELSE 0 END AS toast_bytes, "
" relacl, pg_get_viewdef(oid)";
" relacl, pg_get_viewdef(pg_class.oid)";
if (lessThenVersion(120000))
q += ", relhasoids ";