V$LOGMNR_CONTENTS contains log history information. To query this
view, you must have the LOGMINING privilege.
The LOGMINING privilege was granted to DBA role. When running an anonymous block, all your privileges granted through a role are effective. When running a stored procedure defined with the default definers rights option, ...
To diagnose, inspect the output of this query before and after reconnecting in your question:
SELECT current_user, current_setting('search_path'::text) AS search_path
, relowner::regrole, relnamespace::regnamespace, relname, relacl
, pg_get_viewdef(c.oid) AS view_definition
FROM pg_class c
WHERE relname = 'view' -- actual view name
Some of the permissions you're trying to change don't exist in the way you're trying to use them.
For example, to deny CREATE TABLE and most other DDL statements, for a particular schema, the correct syntax and permission would be DENY ALTER ON SCHEMA::dbo TO MyRole.
This should cover the equivalent of the db_ddladmin role's permissions. (I know it's a ...
Because the new owner don't want to be given an object that a bunch of other people has access to?
Imagine buying a new house. Do you expect other folks to have access to your new house? Or would you say that it is up to you to hand out the keys/codes to your new house - to the people you trust?
It is hard to respond to "why" questions, since we'd ...