Re: ALTER TABLE lock strength reduction patch is unsafe Reply-To:

Поиск
Список
Период
Сортировка
От Noah Misch
Тема Re: ALTER TABLE lock strength reduction patch is unsafe Reply-To:
Дата
Msg-id 20140321174942.GA3969106@tornado.leadboat.com
обсуждение исходный текст
Ответ на Re: ALTER TABLE lock strength reduction patch is unsafe Reply-To:  (Simon Riggs <simon@2ndQuadrant.com>)
Ответы Re: ALTER TABLE lock strength reduction patch is unsafe Reply-To:  (Simon Riggs <simon@2ndQuadrant.com>)
Список pgsql-hackers
On Fri, Mar 21, 2014 at 04:11:12PM +0000, Simon Riggs wrote:
> On 21 March 2014 03:45, Noah Misch <noah@leadboat.com> wrote:
> > On Sat, Mar 08, 2014 at 11:14:30AM +0000, Simon Riggs wrote:

> Thanks for the review. I'll respond to each point on a later email but
> looks nothing much major, apart from the point raised on separate
> thread.

Yep.

> >> + * Be careful to ensure this function is called for Tables and Indexes only.
> >> + * It is not currently safe to be called for Views because security_barrier
> >> + * is listed as an option and so would be allowed to be set at a level lower
> >> + * than AccessExclusiveLock, which would not be correct.
> >
> > This statement is accepted and takes only ShareUpdateExclusiveLock:
> >
> >   alter table information_schema.triggers set (security_barrier = true);
> 
> I find it hard to justify why we accept such a statement. Surely its a
> bug when the named table turns out to be a view? Presumably ALTER
> SEQUENCE and ALTER <other stuff> has checks for the correct object
> type? OMG.

We've framed ALTER TABLE's relkind leniency as a historic artifact.  As a move
toward stricter checks, ALTER TABLE refused to operate on foreign tables in
9.1 and 9.2.  9.3 reversed that course, though.  For better or worse, ALTER
TABLE is nearly a union of the relation ALTER possibilities.  That choice is
well-entrenched.

-- 
Noah Misch
EnterpriseDB                                 http://www.enterprisedb.com



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

Предыдущее
От: Bruce Momjian
Дата:
Сообщение: Re: pg_archivecleanup bug
Следующее
От: Andres Freund
Дата:
Сообщение: [RFC, POC] Don't require a NBuffer sized PrivateRefCount array of local buffer pins