Re: ALTER TABLESPACE MOVE command tag tweak - Mailing list pgsql-hackers

From Tom Lane
Subject Re: ALTER TABLESPACE MOVE command tag tweak
Date
Msg-id 10375.1402692282@sss.pgh.pa.us
Whole thread Raw
In response to ALTER TABLESPACE MOVE command tag tweak  (Alvaro Herrera <alvherre@2ndquadrant.com>)
Responses Re: ALTER TABLESPACE MOVE command tag tweak  (Alvaro Herrera <alvherre@2ndquadrant.com>)
List 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 by date:

Previous
From: Shreesha
Date:
Subject: Re: How to change the pgsql source code and build it??
Next
From: Alvaro Herrera
Date:
Subject: Re: replicating DROP commands across servers