Re: DROP TABLE can be issued by schema owner as well as table owner
От | Bruce Momjian |
---|---|
Тема | Re: DROP TABLE can be issued by schema owner as well as table owner |
Дата | |
Msg-id | 201110151408.p9FE8CK02232@momjian.us обсуждение исходный текст |
Ответ на | Re: DROP TABLE can be issued by schema owner as well as table owner (Robert Haas <robertmhaas@gmail.com>) |
Список | pgsql-docs |
Robert Haas wrote: > 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. OK, done. -- Bruce Momjian <bruce@momjian.us> http://momjian.us EnterpriseDB http://enterprisedb.com + It's impossible for everything to be true. + diff --git a/doc/src/sgml/ref/drop_table.sgml b/doc/src/sgml/ref/drop_table.sgml new file mode 100644 index 239767f..fc51c7c *** a/doc/src/sgml/ref/drop_table.sgml --- b/doc/src/sgml/ref/drop_table.sgml *************** DROP TABLE [ IF EXISTS ] <replaceable cl *** 30,36 **** <para> <command>DROP TABLE</command> removes tables from the database. ! Only its owner and users with the proper permissions can drop a table. To empty a table of rows without destroying the table, use <xref linkend="sql-delete"> or <xref linkend="sql-truncate">. --- 30,36 ---- <para> <command>DROP TABLE</command> removes tables from the database. ! Only the table owner, the schema owner, and superuser can drop a table. To empty a table of rows without destroying the table, use <xref linkend="sql-delete"> or <xref linkend="sql-truncate">.
В списке pgsql-docs по дате отправления: