#include "catalog/namespace.h"
#include "catalog/pg_type.h"
#include "libpq/pqformat.h"
+#include "miscadmin.h"
#include "parser/parsetree.h"
+#include "utils/acl.h"
#include "utils/builtins.h"
ItemPointer tid = PG_GETARG_ITEMPOINTER(1);
ItemPointer result;
Relation rel;
+ AclResult aclresult;
result = (ItemPointer) palloc(sizeof(ItemPointerData));
if (!reloid)
}
rel = heap_open(reloid, AccessShareLock);
+
+ aclresult = pg_class_aclcheck(RelationGetRelid(rel), GetUserId(),
+ ACL_SELECT);
+ if (aclresult != ACLCHECK_OK)
+ aclcheck_error(aclresult, ACL_KIND_CLASS,
+ RelationGetRelationName(rel));
+
if (rel->rd_rel->relkind == RELKIND_VIEW)
return currtid_for_view(rel, tid);
ItemPointer result;
RangeVar *relrv;
Relation rel;
+ AclResult aclresult;
relrv = makeRangeVarFromNameList(textToQualifiedNameList(relname));
rel = heap_openrv(relrv, AccessShareLock);
+
+ aclresult = pg_class_aclcheck(RelationGetRelid(rel), GetUserId(),
+ ACL_SELECT);
+ if (aclresult != ACLCHECK_OK)
+ aclcheck_error(aclresult, ACL_KIND_CLASS,
+ RelationGetRelationName(rel));
+
if (rel->rd_rel->relkind == RELKIND_VIEW)
return currtid_for_view(rel, tid);