Re: ALTER TABLESPACE MOVE command tag tweak

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: ALTER TABLESPACE MOVE command tag tweak
Дата
Msg-id 10375.1402692282@sss.pgh.pa.us
обсуждение исходный текст
Ответ на ALTER TABLESPACE MOVE command tag tweak  (Alvaro Herrera <alvherre@2ndquadrant.com>)
Ответы Re: ALTER TABLESPACE MOVE command tag tweak
Список pgsql-hackers
Alvaro Herrera <alvherre@2ndquadrant.com> writes:
> The ALTER TABLESPACE MOVE command affects tables, not tablespaces; and
> as such, I think event triggers should support that command.  I'm not
> proposing to change event triggers at this stage, but since IMO we will
> want to do that in 9.5, we need it to have a different command tag than
> plain ALTER TABLESPACE.  This is so that check_ddl_tag() can compare
> the tag with ALTER TABLESPACE and say "unsupported", and ALTER
> TABLESPACE MOVE and say "supported".  Both are currently spelled the
> same, which will be a problem.

> Therefore I propose the attached patch for 9.4.

Hm.  While the specific change here seems harmless enough, the argument
for it seems to me to indicate that the very design is broken.  Do you
expect event triggers to distinguish all the different subflavors of
ALTER TABLE, for example, on the basis of the command tag?  Backwards
compatibility is going to prevent us from refining the tag strings
that much.  So ISTM this concern means what we'd better be thinking
about is some other way for event triggers to find out what they're
dealing with.

A different thought is that what event triggers would probably like
is for this command to be reported to them as a series of
ALTER TABLE SET TABLESPACE events, one per moved table.  If it's
done like that then the tag for the outer ALTER TABLESPACE may not
be so important.
        regards, tom lane



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

Предыдущее
От: Shreesha
Дата:
Сообщение: Re: How to change the pgsql source code and build it??
Следующее
От: Alvaro Herrera
Дата:
Сообщение: Re: replicating DROP commands across servers