Re: DROP TABLE can be issued by schema owner as well as table owner - Mailing list pgsql-docs

From Robert Haas
Subject Re: DROP TABLE can be issued by schema owner as well as table owner
Date
Msg-id CA+TgmoYTJgMpkeNV=QUr=rEL5z=fGpceTUy8Y11pPxNax9Q0yw@mail.gmail.com
Whole thread Raw
In response to Re: DROP TABLE can be issued by schema owner as well as table owner  (Bruce Momjian <bruce@momjian.us>)
Responses Re: DROP TABLE can be issued by schema owner as well as table owner
List pgsql-docs
On Fri, Oct 14, 2011 at 11:11 AM, Bruce Momjian <bruce@momjian.us> wrote:
> Robert Haas wrote:
>> On Thu, Oct 13, 2011 at 10:06 AM, Bruce Momjian <bruce@momjian.us> wrote:
>> > I applied the following documentation patch to clarify this issue, and
>> > used generic wording "user with the proper permissions".
>>
>> That doesn't seem like an improvement; what permissions are proper?
>
> No idea, but it hints that other users can do it too.  I thought too
> specific was too complex for this case.

I disagree.  I think it's the purpose of documentation to be specific.
 The code says:

        /* Allow DROP to either table owner or schema owner */
        if (!pg_class_ownercheck(relOid, GetUserId()) &&
            !pg_namespace_ownercheck(classform->relnamespace, GetUserId()))
            aclcheck_error(ACLCHECK_NOT_OWNER, ACL_KIND_CLASS,
                           rel->relname);

So the command can be executed by the owner of the table, the owner of
the containing schema, or the superuser.

That seems simple enough.

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

pgsql-docs by date:

Previous
From: Robert Haas
Date:
Subject: Re: PQconninfoParse()
Next
From: Dmitriy Igrishin
Date:
Subject: Re: PQconninfoParse()