We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see ourdocumentation.
There was an error while loading.Please reload this page.
1 parentfb886c1 commitb56818aCopy full SHA for b56818a
contrib/pgrowlocks/pgrowlocks.c
@@ -97,7 +97,19 @@ pgrowlocks(PG_FUNCTION_ARGS)
97
98
relname=PG_GETARG_TEXT_PP(0);
99
relrv=makeRangeVarFromNameList(textToQualifiedNameList(relname));
100
-rel=heap_openrv(relrv,AccessShareLock);
+rel=relation_openrv(relrv,AccessShareLock);
101
+
102
+if (rel->rd_rel->relkind==RELKIND_PARTITIONED_TABLE)
103
+ereport(ERROR,
104
+(errcode(ERRCODE_WRONG_OBJECT_TYPE),
105
+errmsg("\"%s\" is a partitioned table",
106
+RelationGetRelationName(rel)),
107
+errdetail("Partitioned tables do not contain rows.")));
108
+elseif (rel->rd_rel->relkind!=RELKIND_RELATION)
109
110
111
+errmsg("\"%s\" is not a table",
112
+RelationGetRelationName(rel))));
113
114
/*
115
* check permissions: must have SELECT on table or be in