Re: DROP TABLE vs inheritance

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: DROP TABLE vs inheritance
Дата
Msg-id 3293.1242098296@sss.pgh.pa.us
обсуждение исходный текст
Ответ на DROP TABLE vs inheritance  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: DROP TABLE vs inheritance  (Robert Haas <robertmhaas@gmail.com>)
Re: DROP TABLE vs inheritance  (Alex Hunsaker <badalex@gmail.com>)
Список pgsql-hackers
I wrote:
> it seems that there is a reasonably simple solution: we could make
> find_inheritance_children() and find_all_inheritors() acquire lock
> on each child table as they scan pg_inherits, and do try_relation_open()
> or equivalent to see if the child still exists.  If not, assume the
> table just got dropped and ignore the pg_inherits entry.

I've committed changes along this line, but there was one place that
I thought needed further discussion to decide whether to change it.
That is LockTableCommand(), which has historically attempted to
determine whether the user has privilege on a table before it locks it.
It's still working that way, which means it's at risk of the same
type of child-disappeared problem that I just fixed elsewhere.

I know we've gone back and forth on the question of how LOCK TABLE
should behave, but at the moment I'm leaning towards changing it.
The argument for the way it behaves now seems to be that a user
who has no privileges on a table could cause a momentary denial
of service to those who do by executing LOCK TABLE with an exclusive
lock level.  However, he can do that anyway via ALTER TABLE, which
will happily take out AccessExclusiveLock before it checks any
permissions.  So I'm not seeing the point of risking unsafe behavior
in LOCK TABLE.

Comments?
        regards, tom lane


В списке pgsql-hackers по дате отправления:

Предыдущее
От: Josh Berkus
Дата:
Сообщение: Re: SELECT ... FOR UPDATE [WAIT integer | NOWAIT] for 8.5
Следующее
От: Hitoshi Harada
Дата:
Сообщение: Re: Implementation of GROUPING SETS (T431: Extended grouping capabilities)