File tree Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -97,7 +97,19 @@ pgrowlocks(PG_FUNCTION_ARGS)
9797
9898 relname = PG_GETARG_TEXT_PP (0 );
9999 relrv = makeRangeVarFromNameList (textToQualifiedNameList (relname ));
100- rel = heap_openrv (relrv , AccessShareLock );
100+ 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+ else if (rel -> rd_rel -> relkind != RELKIND_RELATION )
109+ ereport (ERROR ,
110+ (errcode (ERRCODE_WRONG_OBJECT_TYPE ),
111+ errmsg ("\"%s\" is not a table" ,
112+ RelationGetRelationName (rel ))));
101113
102114 /*
103115 * check permissions: must have SELECT on table or be in
You can’t perform that action at this time.
0 commit comments