From ec57a527fdcfbc855202a5d3d2c880a3a5bfd228 Mon Sep 17 00:00:00 2001 From: samir-puranik Date: Mon, 29 Jan 2024 13:41:27 -0500 Subject: [PATCH] initial commit to give datlastsysoid a value for pg 15 and above --- pgsmo/objects/database/templates/15.0_plus/nodes.sql | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pgsmo/objects/database/templates/15.0_plus/nodes.sql b/pgsmo/objects/database/templates/15.0_plus/nodes.sql index b3d18701..f7d8d976 100644 --- a/pgsmo/objects/database/templates/15.0_plus/nodes.sql +++ b/pgsmo/objects/database/templates/15.0_plus/nodes.sql @@ -9,7 +9,10 @@ db.datname as name, ta.spcname as spcname, db.datallowconn, - 0 as datlastsysoid, + {# The first normal object id is given in PG source code. Article here describes it: https://dba.stackexchange.com/questions/316723/oid-release-ranges-for-built-in-aka-standard-database-objects-during-postgresq + # We set datlastsysoid to one less than that for PG 15 and above because the datlastsysoid column no longer is present past that + #} + 16383 as datlastsysoid, has_database_privilege(db.oid, 'CREATE') as cancreate, datdba as owner, db.datistemplate ,